示例#1
0
 protected override BoundBlock BindLambdaBody(LambdaSymbol lambdaSymbol, Binder lambdaBodyBinder, DiagnosticBag diagnostics)
 {
     if (this.IsExpressionLambda)
     {
         return(lambdaBodyBinder.BindLambdaExpressionAsBlock((ExpressionSyntax)this.Body, diagnostics));
     }
     else
     {
         return(lambdaBodyBinder.BindEmbeddedBlock((BlockSyntax)this.Body, diagnostics));
     }
 }
示例#2
0
        protected override BoundBlock BindLambdaBody(LambdaSymbol lambdaSymbol, Binder lambdaBodyBinder, DiagnosticBag diagnostics)
        {
            if (this.IsExpressionLambda)
            {
                return(lambdaBodyBinder.BindLambdaExpressionAsBlock((ExpressionSyntax)this.Body, diagnostics));
            }
            else
            {
#if XSHARP
                BoundBlock block = lambdaBodyBinder.BindEmbeddedBlock((BlockSyntax)this.Body, diagnostics);
                if (lambdaBodyBinder.Compilation.Options.HasRuntime)
                {
                    block = Binder.FixCodeBlockProblems(lambdaSymbol, lambdaBodyBinder, block, diagnostics);
                }
                return(block);
#else
                return(lambdaBodyBinder.BindEmbeddedBlock((BlockSyntax)this.Body, diagnostics));
#endif
            }
        }