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