2 instantiations of BoundDiscardExpression
Microsoft.CodeAnalysis.CSharp (2)
Binder\Binder_Deconstruct.cs (1)
856return new BoundDiscardExpression(syntax, declTypeWithAnnotations.NullableAnnotation, isInferred: type is null, type);
Generated\BoundNodes.xml.Generated.cs (1)
8553var result = new BoundDiscardExpression(this.Syntax, nullableAnnotation, isInferred, type, this.HasErrors);
42 references to BoundDiscardExpression
Microsoft.CodeAnalysis.CSharp (42)
Binder\Binder_Deconstruct.cs (6)
378var pending = (BoundDiscardExpression)expression; 411var pending = (BoundDiscardExpression)variable.Single; 645var variable = new OutDeconstructVarPendingInference(receiverSyntax, variableSymbol: variableSymbol, isDiscardExpression: variableOpt is BoundDiscardExpression); 851private BoundDiscardExpression BindDiscardExpression(
Binder\Binder_Expressions.cs (2)
3540coercedArgument = ((BoundDiscardExpression)argument).SetInferredTypeWithAnnotations(parameterTypeWithAnnotations); 9403return ((BoundDiscardExpression)index).FailInference(this, diagnostics);
Binder\Binder_Invocation.cs (3)
532BoundDiscardExpression discard when !discard.HasExpressionType() => discard.FailInference(this, diagnostics), 2075newArguments[i] = ((BoundDiscardExpression)argument).FailInference(this, null); 2079newArguments[i] = ((BoundDiscardExpression)argument).SetInferredTypeWithAnnotations(TypeWithAnnotations.Create(candidateType));
Binder\Binder_Statements.cs (2)
1432op1 = InferTypeForDiscardAssignment((BoundDiscardExpression)op1, op2, diagnostics); 1457private BoundExpression InferTypeForDiscardAssignment(BoundDiscardExpression op1, BoundExpression op2, BindingDiagnosticBag diagnostics)
Binder\ForEachLoopBinder.cs (1)
402iterationErrorExpression = ((BoundDiscardExpression)iterationErrorExpression).FailInference(this, diagnosticsOpt: null);
BoundTree\BoundDiscardExpression.cs (1)
19public BoundDiscardExpression FailInference(Binder binder, BindingDiagnosticBag? diagnosticsOpt)
BoundTree\BoundExpressionExtensions.cs (1)
272BoundDiscardExpression => true,
FlowAnalysis\AbstractFlowPass.cs (1)
3679public override BoundNode VisitDiscardExpression(BoundDiscardExpression node)
FlowAnalysis\NullableWalker.cs (4)
7548else if (argument is BoundDiscardExpression discard && discard.IsInferred) 9958var discarded = left is BoundDiscardExpression; 9970if (left is BoundDiscardExpression) 11949public override BoundNode? VisitDiscardExpression(BoundDiscardExpression node)
Generated\BoundNodes.xml.Generated.cs (10)
8549public BoundDiscardExpression Update(NullableAnnotation nullableAnnotation, bool isInferred, TypeSymbol? type) 8553var result = new BoundDiscardExpression(this.Syntax, nullableAnnotation, isInferred, type, this.HasErrors); 9280return VisitDiscardExpression((BoundDiscardExpression)node, arg); 9528public virtual R VisitDiscardExpression(BoundDiscardExpression node, A arg) => this.DefaultVisit(node, arg); 9764public virtual BoundNode? VisitDiscardExpression(BoundDiscardExpression node) => this.DefaultVisit(node); 10755public override BoundNode? VisitDiscardExpression(BoundDiscardExpression node) => null; 12160public override BoundNode? VisitDiscardExpression(BoundDiscardExpression node) 14831public override BoundNode? VisitDiscardExpression(BoundDiscardExpression node) 14838BoundDiscardExpression updatedNode = node.Update(node.NullableAnnotation, node.IsInferred, infoAndType.Type); 17045public override TreeDumperNode VisitDiscardExpression(BoundDiscardExpression node, object? arg) => new TreeDumperNode("discardExpression", null, new TreeDumperNode[]
Lowering\DiagnosticsPass_ExpressionTrees.cs (1)
501private void CheckDiscard(BoundDiscardExpression argument)
Lowering\DiagnosticsPass_Warnings.cs (1)
44CheckDiscard((BoundDiscardExpression)argument);
Lowering\LocalRewriter\LocalRewriter_Call.cs (2)
740if (argument is BoundDiscardExpression discard) 1014Debug.Assert(rewrittenArguments.All(arg => arg is not BoundDiscardExpression), "Discards should have been substituted by VisitArguments");
Lowering\LocalRewriter\LocalRewriter_DeconstructionAssignmentOperator.cs (1)
175case BoundDiscardExpression:
Lowering\SyntheticBoundNodeFactory.cs (3)
1710internal BoundLocal MakeTempForDiscard(BoundDiscardExpression node, ArrayBuilder<LocalSymbol> temps) 1718internal BoundLocal MakeTempForDiscard(BoundDiscardExpression node, out LocalSymbol temp) 1733(arg, t) => arg.Kind == BoundKind.DiscardExpression ? t.factory.MakeTempForDiscard((BoundDiscardExpression)arg, t.builder) : arg,
Operations\CSharpOperationFactory.cs (3)
263return CreateBoundDiscardExpressionOperation((BoundDiscardExpression)boundNode); 2541variable = ((BoundDiscardExpression)boundDeclarationPattern.VariableAccess).ExpressionSymbol.GetPublicSymbol(); 2802private IOperation CreateBoundDiscardExpressionOperation(BoundDiscardExpression boundNode)