Roslyn CTP typically uses the following method signature:
LiteralExpressionSyntax LiteralExpression(SyntaxKind kind, SyntaxToken token)
What is the reason for passing SyntaxKind? token has the Kind property, why is Roslyn not using it?
To be more precise, a custom Kind is required, claims to be limited to a narrow set of values, and then checks that token Kind also belongs to that narrow set, provided Kind provided.
Why doesn't Roslyn use token.Kind and allow the user to pass an explicit view?
UPD: Actually, the main question is: what are the situations when the Kind submitted by the user will differ from token kind?
source share