66 instantiations of BoundBadExpression
Microsoft.CodeAnalysis.CSharp (66)
Binder\Binder.ValueChecks.cs (1)
896
return new
BoundBadExpression
(
Binder\Binder.WithQueryLambdaParametersBinder.cs (1)
85
return new
BoundBadExpression
(
Binder\Binder_Conversions.cs (1)
2323
? new
BoundBadExpression
(node.WithElement!.Syntax, LookupResultKind.Empty, symbols: [], naturalWithArguments, CreateErrorType())
Binder\Binder_Expressions.cs (25)
160
return new
BoundBadExpression
(syntax,
173
return new
BoundBadExpression
(syntax,
198
return new
BoundBadExpression
(syntax,
240
return new
BoundBadExpression
(
892
return new
BoundBadExpression
(
1079
boundArgument = new
BoundBadExpression
(
1738
expression = new
BoundBadExpression
(
4591
return new
BoundBadExpression
(
4630
return new
BoundBadExpression
(
4962
return new
BoundBadExpression
(
4973
return new
BoundBadExpression
(
5016
return new
BoundBadExpression
(
5341
return new
BoundBadExpression
(syntax, LookupResultKind.Empty, ImmutableArray<Symbol?>.Empty, ImmutableArray<BoundExpression>.Empty, CreateErrorType());
5466
arguments[i] = new
BoundBadExpression
(
5632
return new
BoundBadExpression
(node, LookupResultKind.NotInvocable, StaticCast<Symbol>.From(type.InstanceConstructors), ImmutableArray.Create(argument), type);
5679
return new
BoundBadExpression
(node, LookupResultKind.OverloadResolutionFailure, StaticCast<Symbol>.From(type.InstanceConstructors), childNodes, type);
5776
return new
BoundBadExpression
(node, LookupResultKind.NotCreatable, ImmutableArray.Create<Symbol?>(type), children.ToImmutableAndFree(), type) { WasCompilerGenerated = wasCompilerGenerated };
5920
var badRight = new
BoundBadExpression
(
7059
return new
BoundBadExpression
(node, resultKind, symbols.ToImmutableAndFree(), childNodes.ToImmutableAndFree(), type);
7227
return new
BoundBadExpression
(node, LookupResultKind.OverloadResolutionFailure, ImmutableArray<Symbol>.Empty, children, interfaceType);
8052
return new
BoundBadExpression
(node, LookupResultKind.Ambiguous, lookupResult.Symbols.AsImmutable(), ImmutableArray.Create(AdjustBadExpressionChild(boundLeft)), CreateErrorType(rightName), hasErrors: true);
8090
return new
BoundBadExpression
(node, lookupResult.Kind, symbols.AsImmutable(), ImmutableArray.Create(AdjustBadExpressionChild(boundLeft)), CreateErrorType(rightName), hasErrors: true);
8275
return new
BoundBadExpression
(syntax, LookupResultKind.Viable, errorTypeSymbol.CandidateSymbols!, [AdjustBadExpressionChild(receiver)], CreateErrorType());
8538
return new
BoundBadExpression
(
9918
return new
BoundBadExpression
(node, LookupResultKind.Empty, ImmutableArray<Symbol>.Empty, childBoundNodes, CreateErrorType(), hasErrors: true);
Binder\Binder_Invocation.cs (1)
771
receiverOpt = new
BoundBadExpression
(
Binder\Binder_Patterns.cs (1)
830
lengthAccess = new
BoundBadExpression
(node, LookupResultKind.Empty, ImmutableArray<Symbol?>.Empty, ImmutableArray<BoundExpression>.Empty, CreateErrorType(), hasErrors: true) { WasCompilerGenerated = true };
Binder\Binder_Query.cs (6)
301
return new
BoundBadExpression
(
741
yExpression = new
BoundBadExpression
(yExpression.Syntax, LookupResultKind.Empty, ImmutableArray<Symbol?>.Empty, ImmutableArray.Create(yExpression), CreateErrorType());
747
yExpression = new
BoundBadExpression
(yExpression.Syntax, LookupResultKind.Empty, ImmutableArray<Symbol?>.Empty, ImmutableArray.Create(yExpression), yExpression.Type);
808
field2Value = new
BoundBadExpression
(field2Value.Syntax, LookupResultKind.Empty, ImmutableArray<Symbol?>.Empty, ImmutableArray.Create(field2Value), field2Value.Type, true);
964
receiver = new
BoundBadExpression
(receiver.Syntax, LookupResultKind.NotAValue, ImmutableArray<Symbol?>.Empty, ImmutableArray.Create(receiver), CreateErrorType());
986
receiver = new
BoundBadExpression
(receiver.Syntax, LookupResultKind.NotAValue, ImmutableArray<Symbol?>.Empty, ImmutableArray.Create(receiver), CreateErrorType());
Binder\Binder_Symbols.cs (2)
1522
receiver = new
BoundBadExpression
(receiver.Syntax, LookupResultKind.Ambiguous, ImmutableArray<Symbol>.Empty, ImmutableArray.Create(receiver), receiver.Type, hasErrors: true).MakeCompilerGenerated();
1532
receiver = new
BoundBadExpression
(receiver.Syntax, LookupResultKind.Empty, ImmutableArray<Symbol>.Empty, childBoundNodes: [AdjustBadExpressionChild(receiver)], receiver.Type, hasErrors: true).MakeCompilerGenerated();
Binder\ForEachLoopBinder.cs (1)
745
return new
BoundBadExpression
(
Binder\SwitchBinder.cs (1)
468
return new
BoundBadExpression
(node, LookupResultKind.Empty, ImmutableArray<Symbol>.Empty, ImmutableArray.Create(switchGoverningExpression), switchGoverningType ?? CreateErrorType());
Generated\BoundNodes.xml.Generated.cs (1)
1019
var result = new
BoundBadExpression
(this.Syntax, resultKind, symbols, childBoundNodes, type, this.HasErrors);
Lowering\ClosureConversion\ClosureConversion.cs (1)
1745
return new
BoundBadExpression
(F.Syntax, LookupResultKind.Empty, ImmutableArray<Symbol>.Empty, ImmutableArray.Create<BoundExpression>(node), node.Type);
Lowering\ClosureConversion\ExpressionLambdaRewriter.cs (5)
358
return new
BoundBadExpression
(node.Syntax, default(LookupResultKind), ImmutableArray<Symbol>.Empty, ImmutableArray.Create<BoundExpression>(node), ExpressionType);
389
return new
BoundBadExpression
(node.Syntax, 0, ImmutableArray<Symbol>.Empty, ImmutableArray.Create<BoundExpression>(node), ExpressionType);
1143
return new
BoundBadExpression
(node.Syntax, default(LookupResultKind), ImmutableArray<Symbol>.Empty, ImmutableArray.Create<BoundExpression>(node), node.Type);
1150
return new
BoundBadExpression
(node.Syntax, default(LookupResultKind), ImmutableArray<Symbol>.Empty, ImmutableArray.Create<BoundExpression>(node), node.Type);
1182
return new
BoundBadExpression
(node.Syntax, default(LookupResultKind), ImmutableArray<Symbol>.Empty, ImmutableArray.Create<BoundExpression>(node), node.Type);
Lowering\LocalRewriter\LocalRewriter.cs (1)
602
return new
BoundBadExpression
(syntax, LookupResultKind.NotReferencable, ImmutableArray<Symbol?>.Empty, children, resultType);
Lowering\LocalRewriter\LocalRewriter_Event.cs (5)
128
clearCall = new
BoundBadExpression
(syntax, LookupResultKind.NotInvocable, ImmutableArray<Symbol?>.Empty, ImmutableArray.Create<BoundExpression>(removeDelegate), ErrorTypeSymbol.UnknownResultType);
170
marshalCall = new
BoundBadExpression
(syntax, LookupResultKind.NotInvocable, ImmutableArray<Symbol?>.Empty, marshalArguments, ErrorTypeSymbol.UnknownResultType);
265
getOrCreateCall = new
BoundBadExpression
(syntax, LookupResultKind.NotInvocable, ImmutableArray<Symbol?>.Empty, ImmutableArray.Create<BoundExpression>(fieldAccess), ErrorTypeSymbol.UnknownResultType);
287
return new
BoundBadExpression
(syntax, LookupResultKind.NotInvocable, ImmutableArray<Symbol?>.Empty, ImmutableArray.Create(getOrCreateCall), ErrorTypeSymbol.UnknownResultType);
345
return new
BoundBadExpression
(node.Syntax, LookupResultKind.NotCreatable, ImmutableArray.Create<Symbol?>(node.Event),
Lowering\LocalRewriter\LocalRewriter_FixedStatement.cs (2)
484
helperCall = new
BoundBadExpression
(fixedInitializer.Syntax, LookupResultKind.NotInvocable, ImmutableArray<Symbol?>.Empty, ImmutableArray<BoundExpression>.Empty, ErrorTypeSymbol.UnknownResultType);
545
lengthCall = new
BoundBadExpression
(fixedInitializer.Syntax, LookupResultKind.NotInvocable, ImmutableArray<Symbol?>.Empty, ImmutableArray.Create<BoundExpression>(factory.Local(pinnedTemp)), ErrorTypeSymbol.UnknownResultType);
Lowering\LocalRewriter\LocalRewriter_LockStatement.cs (2)
117
exitCallExpr = new
BoundBadExpression
(lockSyntax, LookupResultKind.NotInvocable, ImmutableArray<Symbol?>.Empty, ImmutableArray.Create<BoundExpression>(boundLockTemp), ErrorTypeSymbol.UnknownResultType);
212
enterCallExpr = new
BoundBadExpression
(lockSyntax, LookupResultKind.NotInvocable, ImmutableArray<Symbol?>.Empty, ImmutableArray.Create<BoundExpression>(boundLockTemp), ErrorTypeSymbol.UnknownResultType);
Lowering\LocalRewriter\LocalRewriter_ObjectCreationExpression.cs (3)
394
newGuid = new
BoundBadExpression
(node.Syntax, LookupResultKind.NotCreatable, ImmutableArray<Symbol?>.Empty, ImmutableArray<BoundExpression>.Empty, ErrorTypeSymbol.UnknownResultType);
412
callGetTypeFromCLSID = new
BoundBadExpression
(node.Syntax, LookupResultKind.OverloadResolutionFailure, ImmutableArray<Symbol?>.Empty, ImmutableArray<BoundExpression>.Empty, ErrorTypeSymbol.UnknownResultType);
428
rewrittenObjectCreation = new
BoundBadExpression
(node.Syntax, LookupResultKind.OverloadResolutionFailure, ImmutableArray<Symbol?>.Empty, ImmutableArray<BoundExpression>.Empty, node.Type);
Lowering\LocalRewriter\LocalRewriter_StackAlloc.cs (1)
67
constructorCall = new
BoundBadExpression
(
Lowering\LocalRewriter\LocalRewriter_StringInterpolation.cs (1)
228
: new
BoundBadExpression
(syntax, LookupResultKind.Empty, symbols: ImmutableArray<Symbol?>.Empty, childBoundNodes: ImmutableArray<BoundExpression>.Empty, type);
Lowering\LocalRewriter\LocalRewriter_UsingStatement.cs (1)
463
disposeCall = new
BoundBadExpression
(resourceSyntax, LookupResultKind.NotInvocable, ImmutableArray<Symbol?>.Empty, ImmutableArray.Create(disposedExpression), ErrorTypeSymbol.UnknownResultType);
Lowering\LocalRewriter\LoweredDynamicOperation.cs (1)
55
var bad = new
BoundBadExpression
(children[0].Syntax, LookupResultKind.Empty, ImmutableArray<Symbol?>.Empty, children, resultType);
Lowering\SyntheticBoundNodeFactory.cs (2)
246
return new
BoundBadExpression
(Syntax, LookupResultKind.Empty, ImmutableArray<Symbol?>.Empty, ImmutableArray<BoundExpression>.Empty, type, hasErrors: true);
823
return new
BoundBadExpression
(Syntax, default(LookupResultKind), ImmutableArray<Symbol?>.Empty, args.AsImmutable(), receiver);
84 references to BoundBadExpression
Microsoft.CodeAnalysis.CSharp (84)
Binder\Binder_Attributes.cs (1)
523
var
badLHS = BadExpression(nameSyntax, lookupResultKind: LookupResultKind.Empty);
Binder\Binder_Conversions.cs (6)
828
BoundBadExpression
);
831
Debug.Assert(expr is not
BoundBadExpression
{ ChildBoundNodes: var children } || !children.Any((child, node) => child.Syntax == node.Syntax, node));
841
expr is
BoundBadExpression
? Conversion.NoConversion : conversion,
1047
Debug.Assert(collectionCreation is BoundObjectCreationExpressionBase or
BoundBadExpression
);
2252
case
BoundBadExpression
badExpression:
2322
var
collectionCreation = naturalWithArguments.Length > 0
Binder\Binder_Deconstruct.cs (1)
717
private
BoundBadExpression
MissingDeconstruct(BoundExpression receiver, SyntaxNode rightSyntax, int numParameters, BindingDiagnosticBag diagnostics,
Binder\Binder_Expressions.cs (29)
116
/// Generates a new <see cref="
BoundBadExpression
"/> with no known type
118
private
BoundBadExpression
BadExpression(SyntaxNode syntax)
124
/// Generates a new <see cref="
BoundBadExpression
"/> with no known type, and the given bound child.
126
private
BoundBadExpression
BadExpression(SyntaxNode syntax, BoundExpression childNode)
132
/// Generates a new <see cref="
BoundBadExpression
"/> with no known type, and the given bound children.
134
private
BoundBadExpression
BadExpression(SyntaxNode syntax, ImmutableArray<BoundExpression> childNodes)
140
/// Generates a new <see cref="
BoundBadExpression
"/> with no known type, given lookup resultKind.
142
protected
BoundBadExpression
BadExpression(SyntaxNode syntax, LookupResultKind lookupResultKind)
148
/// Generates a new <see cref="
BoundBadExpression
"/> with no known type, given lookup resultKind and the given bound child.
150
protected
BoundBadExpression
BadExpression(SyntaxNode syntax, LookupResultKind lookupResultKind, BoundExpression childNode)
156
/// Generates a new <see cref="
BoundBadExpression
"/> with no known type, given lookupResultKind and given symbols for GetSemanticInfo API.
158
private
BoundBadExpression
BadExpression(SyntaxNode syntax, LookupResultKind resultKind, ImmutableArray<Symbol> symbols)
168
/// Generates a new <see cref="
BoundBadExpression
"/> with no known type, given lookupResultKind and given symbols for GetSemanticInfo API,
171
private
BoundBadExpression
BadExpression(SyntaxNode syntax, LookupResultKind resultKind, ImmutableArray<Symbol> symbols, BoundExpression childNode)
193
/// Generates a new <see cref="
BoundBadExpression
"/> with no known type, given lookupResultKind and given symbols for GetSemanticInfo API,
196
private
BoundBadExpression
BadExpression(SyntaxNode syntax, LookupResultKind resultKind, ImmutableArray<Symbol> symbols, ImmutableArray<BoundExpression> childNodes, bool wasCompilerGenerated = false)
211
/// Otherwise, a new <see cref="
BoundBadExpression
"/> wrapping <paramref name="expr"/> is returned.
216
/// Returned expression need not be a <see cref="
BoundBadExpression
"/>, but is guaranteed to have HasErrors set to true.
233
var
badExpression = (
BoundBadExpression
)expr;
257
/// did not meet the requirements, the return value will be a <see cref="
BoundBadExpression
"/> that
5279
Debug.Assert(result is not
BoundBadExpression
{ ChildBoundNodes: var children } || !children.Any((child, node) => child.Syntax == node, node));
5443
static (BoundUnconvertedWithElement? withElement,
BoundBadExpression
? badExpression) bindWithElement(
5474
BoundBadExpression
? badExpression;
5750
var
result = MakeBadExpressionForObjectCreation(node.Syntax, CreateErrorType(), arguments, node.InitializerOpt, typeSyntax: node.Syntax, diagnostics);
5761
private
BoundBadExpression
MakeBadExpressionForObjectCreation(SyntaxNode node, TypeSymbol type, AnalyzedArguments analyzedArguments, InitializerExpressionSyntax? initializerOpt, SyntaxNode? typeSyntax, BindingDiagnosticBag diagnostics, bool wasCompilerGenerated = false)
5920
var
badRight = new BoundBadExpression(
7180
var
bad = (
BoundBadExpression
)classCreation;
Binder\Binder_Patterns.cs (2)
683
Debug.Assert(indexerAccess is BoundIndexerAccess or BoundImplicitIndexerAccess or BoundArrayAccess or
BoundBadExpression
or BoundDynamicIndexerAccess);
849
Debug.Assert(indexerAccess is BoundIndexerAccess or BoundImplicitIndexerAccess or BoundArrayAccess or
BoundBadExpression
or BoundDynamicIndexerAccess or BoundPointerElementAccess);
Binder\Binder_Statements.cs (1)
1759
BoundBadExpression
=> null,
BoundTree\BoundCollectionExpression.cs (2)
45
/// <item>or a <see cref="
BoundBadExpression
"/> in the case of errors where the <c>with(...)</c> element does
60
or
BoundBadExpression
);
BoundTree\BoundExpressionExtensions.cs (1)
197
foreach (var s in ((
BoundBadExpression
)node).Symbols)
BoundTree\BoundImplicitIndexerAccess.cs (1)
20
Debug.Assert(LengthOrCountAccess is BoundPropertyAccess or BoundArrayLength or BoundLocal or
BoundBadExpression
);
BoundTree\BoundListPattern.cs (2)
22
Debug.Assert(LengthAccess is null or BoundPropertyAccess or
BoundBadExpression
);
23
Debug.Assert(IndexerAccess is null or BoundIndexerAccess or BoundImplicitIndexerAccess or BoundArrayAccess or
BoundBadExpression
or BoundDynamicIndexerAccess or BoundPointerElementAccess);
BoundTree\BoundSlicePattern.cs (1)
19
Debug.Assert(IndexerAccess is null or BoundIndexerAccess or BoundImplicitIndexerAccess or BoundArrayAccess or
BoundBadExpression
or BoundDynamicIndexerAccess);
BoundTree\InterpolatedStringHandlerData.cs (1)
37
Debug.Assert(construction is BoundObjectCreationExpression or BoundDynamicObjectCreationExpression or
BoundBadExpression
);
Compilation\CSharpSemanticModel.cs (10)
1932
if (highestBoundNode is
BoundBadExpression
badExpression)
3379
var
expr = (
BoundBadExpression
)boundNode;
3412
((
BoundBadExpression
)boundNodeForSyntacticParent).ResultKind == LookupResultKind.NotCreatable)
4022
BoundBadExpression
boundBadExpression = (
BoundBadExpression
)boundNodeForSyntacticParent;
4359
symbols = OneOrMany.Create(((
BoundBadExpression
)boundNodeForSyntacticParent).Symbols.WhereAsArray((sym, myMethodGroup) => myMethodGroup.Contains(sym), myMethodGroup));
4362
resultKind = ((
BoundBadExpression
)boundNodeForSyntacticParent).ResultKind;
4460
symbols = OneOrMany.Create(((
BoundBadExpression
)boundNodeForSyntacticParent).Symbols.WhereAsArray((sym, myPropertyGroup) => myPropertyGroup.Contains(sym), myPropertyGroup));
4463
resultKind = ((
BoundBadExpression
)boundNodeForSyntacticParent).ResultKind;
Compiler\MethodCompiler.cs (1)
2450
public override BoundNode? VisitBadExpression(
BoundBadExpression
node)
FlowAnalysis\AbstractFlowPass.cs (1)
1631
public override BoundNode VisitBadExpression(
BoundBadExpression
node)
FlowAnalysis\DefiniteAssignment.cs (2)
1617
var
bad = (
BoundBadExpression
)node;
FlowAnalysis\NullableWalker.cs (1)
12680
public override BoundNode? VisitBadExpression(
BoundBadExpression
node)
FlowAnalysis\NullableWalker.DebugVerifier.cs (1)
170
public override BoundNode? VisitBadExpression(
BoundBadExpression
node)
Generated\BoundNodes.xml.Generated.cs (10)
1015
public
BoundBadExpression
Update(LookupResultKind resultKind, ImmutableArray<Symbol?> symbols, ImmutableArray<BoundExpression> childBoundNodes, TypeSymbol? type)
1019
var
result = new BoundBadExpression(this.Syntax, resultKind, symbols, childBoundNodes, type, this.HasErrors);
9138
return VisitBadExpression((
BoundBadExpression
)node, arg);
9599
public virtual R VisitBadExpression(
BoundBadExpression
node, A arg) => this.DefaultVisit(node, arg);
9840
public virtual BoundNode? VisitBadExpression(
BoundBadExpression
node) => this.DefaultVisit(node);
10105
public override BoundNode? VisitBadExpression(
BoundBadExpression
node)
11219
public override BoundNode? VisitBadExpression(
BoundBadExpression
node)
12952
public override BoundNode? VisitBadExpression(
BoundBadExpression
node)
12956
BoundBadExpression
updatedNode;
15627
public override TreeDumperNode VisitBadExpression(
BoundBadExpression
node, object? arg) => new TreeDumperNode("badExpression", null, new TreeDumperNode[]
Lowering\AsyncRewriter\AsyncMethodToStateMachineRewriter.cs (1)
338
public sealed override BoundNode VisitBadExpression(
BoundBadExpression
node)
Lowering\LocalRewriter\LocalRewriter.cs (1)
577
public override BoundNode VisitBadExpression(
BoundBadExpression
node)
Lowering\LocalRewriter\LoweredDynamicOperation.cs (2)
55
var
bad = new BoundBadExpression(children[0].Syntax, LookupResultKind.Empty, ImmutableArray<Symbol?>.Empty, children, resultType);
63
Debug.Assert(SiteInitialization == null && SiteInvocation is
BoundBadExpression
&& _temps.IsDefaultOrEmpty);
Lowering\SpillSequenceSpiller.cs (1)
981
public override BoundNode VisitBadExpression(
BoundBadExpression
node)
Lowering\SyntheticBoundNodeFactory.cs (1)
244
public
BoundBadExpression
BadExpression(TypeSymbol type)
Operations\CSharpOperationFactory.cs (4)
119
return CreateBoundBadExpressionOperation((
BoundBadExpression
)boundNode);
1322
if (collectionCreation is
BoundBadExpression
boundBad)
1476
private IInvalidOperation CreateBoundBadExpressionOperation(
BoundBadExpression
boundBadExpression)
2387
case
BoundBadExpression
bad: