4 instantiations of BoundLambda
Microsoft.CodeAnalysis.CSharp (4)
BoundTree\UnboundLambda.cs (3)
918var result = new BoundLambda(_unboundLambda.Syntax, _unboundLambda, block, diagnostics.ToReadOnlyAndFree(), lambdaBodyBinder, delegateType, inferredReturnType: default) 1021var result = new BoundLambda( 1279return new BoundLambda(
Generated\BoundNodes.xml.Generated.cs (1)
7632var result = new BoundLambda(this.Syntax, unboundLambda, symbol, body, diagnostics, binder, type, this.HasErrors);
116 references to BoundLambda
Microsoft.CodeAnalysis.CSharp (116)
Binder\Binder_Conversions.cs (1)
2221var boundLambda = unboundLambda.Bind((NamedTypeSymbol)destination, isExpressionTree: destination.IsGenericOrNonGenericExpressionType(out _)).WithInAnonymousFunctionConversion();
Binder\Binder_Expressions.cs (1)
5426BoundLambda boundLambda = unboundLambda.Bind(type, isExpressionTree: false);
Binder\Binder_Invocation.cs (2)
2187var discarded = unboundArgument.Bind((NamedTypeSymbol)parameterType, isExpressionTree: false); 2193BoundLambda boundLambda = unboundArgument.BindForErrorRecovery();
Binder\Binder_Operators.cs (1)
4142case BoundLambda _:
Binder\Binder_Query.cs (2)
692var l1 = c1 != null ? c1.Operand as BoundLambda : null;
Binder\Binder_Statements.cs (2)
2089var lambda = anonymousFunction.BindForErrorRecovery(); 2259var bindingResult = anonymousFunction.Bind(delegateType, isExpressionTree: false);
Binder\RefSafetyAnalysis.cs (2)
308BoundLambda lambda => lambda.Body != node, 378public override BoundNode? VisitLambda(BoundLambda node)
Binder\Semantics\Conversions\ConversionsBase.cs (1)
1577var bound = anonymousFunction.Bind(delegateType, isTargetExpressionTree);
Binder\Semantics\OverloadResolution\OverloadResolution.cs (1)
3289BoundLambda lambda = ((UnboundLambda)node).BindForReturnTypeInference(d);
BoundTree\BoundTreeVisitors.cs (1)
126return VisitLambda(node as BoundLambda, arg);
BoundTree\NullabilityRewriter.cs (2)
216return (T)remapLambda((BoundLambda)expr, lambda); 231Symbol remapLambda(BoundLambda boundLambda, LambdaSymbol lambda)
BoundTree\UnboundLambda.cs (40)
97internal BoundLambda WithInAnonymousFunctionConversion() 104var result = (BoundLambda)MemberwiseClone(); 198BoundLambda node, Binder binder, TypeSymbol? delegateType, bool isAsync, ConversionsBase conversions) 467public BoundLambda Bind(NamedTypeSymbol delegateType, bool isExpressionTree) 470public BoundLambda BindForErrorRecovery() 473public BoundLambda BindForReturnTypeInference(NamedTypeSymbol delegateType) 476private BoundLambda SuppressIfNeeded(BoundLambda lambda) 477=> this.IsSuppressed ? (BoundLambda)lambda.WithSuppression() : lambda; 543Constraint = "Avoid " + nameof(ConcurrentDictionary<(NamedTypeSymbol, bool), BoundLambda>) + " which has a large default size, but this cache is normally small.")] 544private ImmutableDictionary<(NamedTypeSymbol Type, bool IsExpressionLambda), BoundLambda>? _bindingCache; 548Constraint = "Avoid " + nameof(ConcurrentDictionary<ReturnInferenceCacheKey, BoundLambda>) + " which has a large default size, but this cache is normally small.")] 549private ImmutableDictionary<ReturnInferenceCacheKey, BoundLambda>? _returnInferenceCache; 551private BoundLambda? _errorBinding; 560_bindingCache = ImmutableDictionary<(NamedTypeSymbol Type, bool IsExpressionLambda), BoundLambda>.Empty.WithComparers(BindingCacheComparer.Instance); 561_returnInferenceCache = ImmutableDictionary<ReturnInferenceCacheKey, BoundLambda>.Empty; 636public BoundLambda Bind(NamedTypeSymbol delegateType, bool isTargetExpressionTree) 640if (!_bindingCache!.TryGetValue((delegateType, inExpressionTree), out BoundLambda? result)) 652foreach (var lambda in _returnInferenceCache!.Values) 762BoundLambda.BlockReturns.GetReturnTypes(returnTypes, block); 763var inferredReturnType = BoundLambda.InferReturnType( 816private BoundLambda ReallyBind(NamedTypeSymbol delegateType, bool inExpressionTree) 841_returnInferenceCache!.TryGetValue(cacheKey, out BoundLambda? returnInferenceLambda) && 918var result = new BoundLambda(_unboundLambda.Syntax, _unboundLambda, block, diagnostics.ToReadOnlyAndFree(), lambdaBodyBinder, delegateType, inferredReturnType: default) 975private BoundLambda ReallyInferReturnType( 1001BoundLambda.BlockReturns.GetReturnTypes(returnTypes, block); 1002inferredReturnType = BoundLambda.InferReturnType(returnTypes, _unboundLambda, lambdaBodyBinder, delegateType, lambdaSymbol.IsAsync, lambdaBodyBinder.Conversions); 1021var result = new BoundLambda( 1063public BoundLambda BindForReturnTypeInference(NamedTypeSymbol delegateType) 1067BoundLambda? result; 1078/// Behavior of this key should be kept aligned with <see cref="BoundLambda.InferReturnTypeImpl"/>. 1213public BoundLambda BindForErrorRecovery() 1231private BoundLambda ReallyBindForErrorRecovery() 1243[return: NotNullIfNotNull(nameof(lambda))] BoundLambda? rebind(BoundLambda? lambda) 1253private BoundLambda ReallyBindForErrorRecovery( 1299private static BoundLambda? GuessBestBoundLambda<T>(ImmutableDictionary<T, BoundLambda> candidates) 1310IEnumerable<KeyValuePair<T, BoundLambda>> minDiagnosticsGroup = candidates.GroupBy(lambda => lambda.Value.Diagnostics.Diagnostics.Length).OrderBy(group => group.Key).First();
Compilation\CSharpSemanticModel.cs (5)
2093var lambda = (BoundLambda)highestBoundExpr; 2228var lambda = (BoundLambda)boundExpr; 2234var lambda = ((UnboundLambda)boundExpr).BindForErrorRecovery();
Compilation\MemberSemanticModel.cs (3)
1788result = GetLambdaEnclosingBinder(position, node, innerLambdaOrQuery, ((BoundLambda)boundInnerLambdaOrQuery).Binder); 1853var lambda = (BoundLambda)node;
FlowAnalysis\AbstractFlowPass.cs (1)
1279public override BoundNode VisitLambda(BoundLambda node) => null;
FlowAnalysis\AbstractRegionControlFlowPass.cs (1)
31public override BoundNode VisitLambda(BoundLambda node)
FlowAnalysis\AbstractRegionDataFlowPass.cs (1)
44public override BoundNode VisitLambda(BoundLambda node)
FlowAnalysis\DefiniteAssignment.cs (1)
2378public override BoundNode VisitLambda(BoundLambda node)
FlowAnalysis\NullableWalker.cs (15)
1796BoundLambda lambda, 1961if (node is BoundLambda boundLambda && originalSymbol is LambdaSymbol l && updatedSymbol is NamedTypeSymbol n) 8553return getUnboundLambda((BoundLambda)argument, GetVariableState(_variables, lambdaState.Value), _getterNullResilienceData); 8599static UnboundLambda getUnboundLambda(BoundLambda expr, VariableState variableState, GetterNullResilienceData? getterNullResilienceData) 9304private void ReportNullabilityMismatchWithTargetDelegate(Location location, NamedTypeSymbol delegateType, BoundLambda lambda) 9507if (conversionOperand is BoundLambda lambda) 10254case BoundLambda lambda: 10342Action<NamedTypeSymbol>? visitLambdaArgument(NamedTypeSymbol delegateType, BoundLambda lambda, bool isTargetTyped) 10349Action<NamedTypeSymbol>? analyzeLambdaConversion(NamedTypeSymbol delegateType, BoundLambda lambda, bool isTargetTyped) 10366Action<NamedTypeSymbol> analyzeLambdaConversionAsContinuation(BoundLambda lambda) 10506public override BoundNode? VisitLambda(BoundLambda node) 10520private void VisitLambda(BoundLambda node, NamedTypeSymbol? delegateTypeOpt, Optional<LocalState> initialState = default) 10540private static void UseDelegateInvokeParameterAndReturnTypes(BoundLambda lambda, MethodSymbol? delegateInvokeMethod, out bool useDelegateInvokeParameterTypes, out bool useDelegateInvokeReturnType) 10559var lambda = node.BindForErrorRecovery(); 12040if (child is BoundLambda lambda)
FlowAnalysis\NullableWalker.SnapshotManager.cs (1)
235if (node is BoundLambda && symbol is LambdaSymbol)
FlowAnalysis\VariablesDeclaredWalker.cs (1)
183public override BoundNode? VisitLambda(BoundLambda node)
Generated\BoundNodes.xml.Generated.cs (10)
7628public BoundLambda Update(UnboundLambda unboundLambda, MethodSymbol symbol, BoundBlock body, ReadOnlyBindingDiagnostic<AssemblySymbol> diagnostics, Binder binder, TypeSymbol? type) 7632var result = new BoundLambda(this.Syntax, unboundLambda, symbol, body, diagnostics, binder, type, this.HasErrors); 9275return VisitLambda((BoundLambda)node, arg); 9548public virtual R VisitLambda(BoundLambda node, A arg) => this.DefaultVisit(node, arg); 9784public virtual BoundNode? VisitLambda(BoundLambda node) => this.DefaultVisit(node); 10682public override BoundNode? VisitLambda(BoundLambda node) 12162public override BoundNode? VisitLambda(BoundLambda node) 14722public override BoundNode? VisitLambda(BoundLambda node) 14727BoundLambda updatedNode; 16974public override TreeDumperNode VisitLambda(BoundLambda node, object? arg) => new TreeDumperNode("lambda", null, new TreeDumperNode[]
Lowering\AsyncRewriter\AsyncExceptionHandlerRewriter.cs (4)
765public override BoundNode VisitLambda(BoundLambda node) 775var result = (BoundLambda)base.VisitLambda(node); 949public override BoundNode VisitLambda(BoundLambda node)
Lowering\ClosureConversion\ClosureConversion.Analysis.Tree.cs (1)
443public override BoundNode VisitLambda(BoundLambda node)
Lowering\ClosureConversion\ClosureConversion.cs (4)
1338return RewriteLambdaConversion((BoundLambda)node.Argument); 1400var result = (BoundExpression)RewriteLambdaConversion((BoundLambda)conversion.Operand); 1621private BoundNode RewriteLambdaConversion(BoundLambda node) 1791public override BoundNode VisitLambda(BoundLambda node)
Lowering\ClosureConversion\ExpressionLambdaRewriter.cs (4)
112internal static BoundNode RewriteLambda(BoundLambda node, TypeCompilationState compilationState, TypeMap typeMap, int recursionDepth, BindingDiagnosticBag diagnostics) 220return VisitLambda((BoundLambda)node); 828private BoundExpression VisitLambda(BoundLambda node) 834private BoundExpression VisitLambdaInternal(BoundLambda node)
Lowering\DiagnosticsPass_ExpressionTrees.cs (1)
604public override BoundNode VisitLambda(BoundLambda node)
Lowering\ExtensionMethodBodyRewriter.cs (1)
92public override BoundNode? VisitLambda(BoundLambda node)
Lowering\LocalRewriter\LocalRewriter.cs (1)
326public override BoundNode VisitLambda(BoundLambda node)
Lowering\SpillSequenceSpiller.cs (1)
1407public override BoundNode VisitLambda(BoundLambda node)
Operations\CSharpOperationFactory.cs (4)
88return CreateBoundLambdaOperation((BoundLambda)boundNode); 990BoundLambda boundLambda = unboundLambda.BindForErrorRecovery(); 994private IAnonymousFunctionOperation CreateBoundLambdaOperation(BoundLambda boundLambda) 1071((boundOperand as BoundLambda)?.Body.Statements.SingleOrDefault() as BoundReturnStatement)?.