示例#1
0
        private static void AssertIsClosureScopeSyntax(CSharpSyntaxNode syntaxOpt)
        {
            // See C# specification, chapter 3.7 Scopes.

            // static lambdas technically have the class scope so the scope syntax is null
            if (syntaxOpt == null)
            {
                return;
            }

            if (SyntaxUtilities.IsClosureScope(syntaxOpt))
            {
                return;
            }

            throw ExceptionUtilities.UnexpectedValue(syntaxOpt.Kind());
        }
示例#2
0
 internal sealed override SyntaxNode GetCorrespondingLambdaBody(SyntaxNode body)
 {
     return(SyntaxUtilities.GetCorrespondingLambdaBody(body, this));
 }