Skip to main content

CLR internals checkpoint

Challenge on lesson: Checkpoint: CLR internals

CHALLENGE
Difficulty: advanced+25 XP

Implement static (string ilName, bool isSealed, int methodCount) Inspect<T>() using reflection: return the type's full name, whether it is sealed, and its declared instance method count. Then implement static string DispatchDescription(Type t) returning exactly "virtual" if t has any virtual methods (declared, instance), "interface" if it implements any interfaces, otherwise "direct". The graded insight: typeof(List<int>) reports sealed, virtual, and interface all at once.

Back to lesson: Checkpoint: CLR internals