BoundTree\UnboundLambda.cs (40)
94internal BoundLambda WithInAnonymousFunctionConversion()
101var result = (BoundLambda)MemberwiseClone();
186BoundLambda node, Binder binder, TypeSymbol? delegateType, bool isAsync, ConversionsBase conversions)
449public BoundLambda Bind(NamedTypeSymbol delegateType, bool isExpressionTree)
452public BoundLambda BindForErrorRecovery()
455public BoundLambda BindForReturnTypeInference(NamedTypeSymbol delegateType)
458private BoundLambda SuppressIfNeeded(BoundLambda lambda)
459=> this.IsSuppressed ? (BoundLambda)lambda.WithSuppression() : lambda;
504Constraint = "Avoid " + nameof(ConcurrentDictionary<(NamedTypeSymbol, bool), BoundLambda>) + " which has a large default size, but this cache is normally small.")]
505private ImmutableDictionary<(NamedTypeSymbol Type, bool IsExpressionLambda), BoundLambda>? _bindingCache;
509Constraint = "Avoid " + nameof(ConcurrentDictionary<ReturnInferenceCacheKey, BoundLambda>) + " which has a large default size, but this cache is normally small.")]
510private ImmutableDictionary<ReturnInferenceCacheKey, BoundLambda>? _returnInferenceCache;
512private BoundLambda? _errorBinding;
521_bindingCache = ImmutableDictionary<(NamedTypeSymbol Type, bool IsExpressionLambda), BoundLambda>.Empty.WithComparers(BindingCacheComparer.Instance);
522_returnInferenceCache = ImmutableDictionary<ReturnInferenceCacheKey, BoundLambda>.Empty;
597public BoundLambda Bind(NamedTypeSymbol delegateType, bool isTargetExpressionTree)
601if (!_bindingCache!.TryGetValue((delegateType, inExpressionTree), out BoundLambda? result))
613foreach (var lambda in _returnInferenceCache!.Values)
720BoundLambda.BlockReturns.GetReturnTypes(returnTypes, block);
721var inferredReturnType = BoundLambda.InferReturnType(
773private BoundLambda ReallyBind(NamedTypeSymbol delegateType, bool inExpressionTree)
798_returnInferenceCache!.TryGetValue(cacheKey, out BoundLambda? returnInferenceLambda) &&
874var result = new BoundLambda(_unboundLambda.Syntax, _unboundLambda, block, diagnostics.ToReadOnlyAndFree(), lambdaBodyBinder, delegateType, inferredReturnType: default)
929private BoundLambda ReallyInferReturnType(
954BoundLambda.BlockReturns.GetReturnTypes(returnTypes, block);
955inferredReturnType = BoundLambda.InferReturnType(returnTypes, _unboundLambda, lambdaBodyBinder, delegateType, lambdaSymbol.IsAsync, lambdaBodyBinder.Conversions);
969var result = new BoundLambda(
1005public BoundLambda BindForReturnTypeInference(NamedTypeSymbol delegateType)
1009BoundLambda? result;
1020/// Behavior of this key should be kept aligned with <see cref="BoundLambda.InferReturnTypeImpl"/>.
1155public BoundLambda BindForErrorRecovery()
1173private BoundLambda ReallyBindForErrorRecovery()
1185[return: NotNullIfNotNull(nameof(lambda))] BoundLambda? rebind(BoundLambda? lambda)
1195private BoundLambda ReallyBindForErrorRecovery(
1238private static BoundLambda? GuessBestBoundLambda<T>(ImmutableDictionary<T, BoundLambda> candidates)
1249IEnumerable<KeyValuePair<T, BoundLambda>> minDiagnosticsGroup = candidates.GroupBy(lambda => lambda.Value.Diagnostics.Diagnostics.Length).OrderBy(group => group.Key).First();
FlowAnalysis\NullableWalker.cs (15)
1668BoundLambda lambda,
1826if (node is BoundLambda boundLambda && originalSymbol is LambdaSymbol l && updatedSymbol is NamedTypeSymbol n)
7797return getUnboundLambda((BoundLambda)argument, GetVariableState(_variables, lambdaState.Value));
7843static UnboundLambda getUnboundLambda(BoundLambda expr, VariableState variableState)
8512private void ReportNullabilityMismatchWithTargetDelegate(Location location, NamedTypeSymbol delegateType, BoundLambda lambda)
8715if (conversionOperand is BoundLambda lambda)
9443case BoundLambda lambda:
9531Action<NamedTypeSymbol>? visitLambdaArgument(NamedTypeSymbol delegateType, BoundLambda lambda, bool isTargetTyped)
9538Action<NamedTypeSymbol>? analyzeLambdaConversion(NamedTypeSymbol delegateType, BoundLambda lambda, bool isTargetTyped)
9555Action<NamedTypeSymbol> analyzeLambdaConversionAsContinuation(BoundLambda lambda)
9683public override BoundNode? VisitLambda(BoundLambda node)
9697private void VisitLambda(BoundLambda node, NamedTypeSymbol? delegateTypeOpt, Optional<LocalState> initialState = default)
9717private static void UseDelegateInvokeParameterAndReturnTypes(BoundLambda lambda, MethodSymbol? delegateInvokeMethod, out bool useDelegateInvokeParameterTypes, out bool useDelegateInvokeReturnType)
9736var lambda = node.BindForErrorRecovery();
10999if (child is BoundLambda lambda)
Generated\BoundNodes.xml.Generated.cs (10)
7616public BoundLambda Update(UnboundLambda unboundLambda, LambdaSymbol symbol, BoundBlock body, ReadOnlyBindingDiagnostic<AssemblySymbol> diagnostics, Binder binder, TypeSymbol? type)
7620var result = new BoundLambda(this.Syntax, unboundLambda, symbol, body, diagnostics, binder, type, this.HasErrors);
9227return VisitLambda((BoundLambda)node, arg);
9500public virtual R VisitLambda(BoundLambda node, A arg) => this.DefaultVisit(node, arg);
9736public virtual BoundNode? VisitLambda(BoundLambda node) => this.DefaultVisit(node);
10633public override BoundNode? VisitLambda(BoundLambda node)
11981public override BoundNode? VisitLambda(BoundLambda node)
14538public override BoundNode? VisitLambda(BoundLambda node)
14543BoundLambda updatedNode;
16796public override TreeDumperNode VisitLambda(BoundLambda node, object? arg) => new TreeDumperNode("lambda", null, new TreeDumperNode[]