Skip to main content

Practice · 2 of 3

Semantic resolution

CHALLENGE
Difficulty: advanced+25 XP

Implement static string TypeOfExpression(string source): parse the source (a single statement or expression), get the SemanticModel from a CSharpCompilation, find the first InvocationExpressionSyntax, and return the fully-qualified type name of its resolved method's ContainingType, or "?" when it does not resolve.

Back to lesson: Practice: Roslyn drills