1 instantiation of BoundLiteral
Microsoft.CodeAnalysis.CSharp (1)
Generated\BoundNodes.xml.Generated.cs (1)
4321var result = new BoundLiteral(this.Syntax, constantValueOpt, type, this.HasErrors);
75 references to BoundLiteral
Microsoft.CodeAnalysis.CSharp (75)
Binder\Binder_Attributes.cs (1)
389(arguments[argIndex].IsParamsArrayOrCollection && arguments[argIndex] is BoundArrayCreation { Bounds: [BoundLiteral { ConstantValueOpt.Value: 0 }] }) ?
Binder\Binder_Await.cs (1)
370var receiver = new BoundLiteral(node, ConstantValue.Null, awaiterType);
Binder\Binder_Expressions.cs (3)
6395({ Type: null } or BoundLiteral or BoundUnconvertedInterpolatedString or BoundBinaryOperator { IsUnconvertedInterpolatedStringAddition: true }) && 7281private BoundLiteral BindLiteralConstant(LiteralExpressionSyntax node, BindingDiagnosticBag diagnostics) 7717if (boundLeft.Kind == BoundKind.Literal && ((BoundLiteral)boundLeft).ConstantValueOpt == ConstantValue.Null)
Binder\Binder_InterpolatedString.cs (7)
98BoundLiteral? format = null; 407Debug.Assert(part is BoundLiteral && part.ConstantValueOpt?.StringValue != null); 436=> parts.All(p => p is BoundLiteral or BoundStringInsert { Value.Type.SpecialType: SpecialType.System_String, Alignment: null, Format: null }); 887Debug.Assert(part is BoundLiteral { Type: { SpecialType: SpecialType.System_String }, ConstantValueOpt.IsString: true }); 920Debug.Assert(part is BoundLiteral or BoundStringInsert); 951var boundLiteral = (BoundLiteral)part;
Binder\Binder_Operators.cs (2)
2710BoundLiteral constant = BindIntegralMinValConstants(node, operand, diagnostics); 3066private BoundLiteral BindIntegralMinValConstants(PrefixUnaryExpressionSyntax node, BoundExpression operand, BindingDiagnosticBag diagnostics)
Binder\Binder_TupleOperators.cs (1)
101case BoundLiteral _:
Binder\Semantics\Conversions\ConversionsBase.cs (1)
1759BoundLiteral intMaxValueLiteral = new BoundLiteral(syntaxNode, ConstantValue.Create(int.MaxValue), expectedAttributeType);
Binder\Semantics\OverloadResolution\OverloadResolutionResult.cs (1)
1369=> argument is BoundLiteral { Type.SpecialType: SpecialType.System_String } &&
BoundTree\BoundNode.cs (1)
362this is BoundArrayCreation { Bounds: [BoundLiteral { WasCompilerGenerated: true }], InitializerOpt: BoundArrayInitialization { WasCompilerGenerated: true }, WasCompilerGenerated: true } or
BoundTree\BoundNode_Source.cs (1)
236case BoundLiteral literal:
BoundTree\BoundTreeVisitors.cs (1)
98return VisitLiteral(node as BoundLiteral, arg);
Compilation\CSharpCompilation.cs (1)
2185var dumbInstance = new BoundLiteral(syntax, ConstantValue.Null, namedType);
Compiler\AnonymousTypeMethodBodySynthesizer.cs (1)
201BoundLiteral boundHashFactor = null;
Compiler\MethodBodySynthesizer.Lowered.cs (1)
356ref BoundLiteral? boundHashFactor,
FlowAnalysis\AbstractFlowPass.cs (1)
1655public override BoundNode VisitLiteral(BoundLiteral node)
FlowAnalysis\NullableWalker.cs (1)
11590public override BoundNode? VisitLiteral(BoundLiteral node)
Generated\BoundNodes.xml.Generated.cs (17)
4317public BoundLiteral Update(ConstantValue? constantValueOpt, TypeSymbol? type) 4321var result = new BoundLiteral(this.Syntax, constantValueOpt, type, this.HasErrors); 7912public BoundStringInsert(SyntaxNode syntax, BoundExpression value, BoundExpression? alignment, BoundLiteral? format, bool isInterpolatedStringHandlerAppendCall, bool hasErrors = false) 7927public BoundLiteral? Format { get; } 7933public BoundStringInsert Update(BoundExpression value, BoundExpression? alignment, BoundLiteral? format, bool isInterpolatedStringHandlerAppendCall) 9055return VisitLiteral((BoundLiteral)node, arg); 9415public virtual R VisitLiteral(BoundLiteral node, A arg) => this.DefaultVisit(node, arg); 9651public virtual BoundNode? VisitLiteral(BoundLiteral node) => this.DefaultVisit(node); 10227public override BoundNode? VisitLiteral(BoundLiteral node) => null; 11441public override BoundNode? VisitLiteral(BoundLiteral node) 12041BoundLiteral? format = (BoundLiteral?)this.Visit(node.Format); 13472public override BoundNode? VisitLiteral(BoundLiteral node) 13479BoundLiteral updatedNode = node.Update(node.ConstantValueOpt, infoAndType.Type); 14676BoundLiteral? format = (BoundLiteral?)this.Visit(node.Format); 15942public override TreeDumperNode VisitLiteral(BoundLiteral node, object? arg) => new TreeDumperNode("literal", null, new TreeDumperNode[]
Lowering\ClosureConversion\ExpressionLambdaRewriter.cs (2)
550var literal = operand as BoundLiteral;
Lowering\IteratorRewriter\IteratorMethodToStateMachineRewriter.cs (1)
284BoundLiteral result = this.F.Literal(!finished);
Lowering\LocalRewriter\LocalRewriter_Call.cs (2)
1133if (possibleParamsArray.IsParamsArrayOrCollection && !_inExpressionLambda && ((BoundArrayCreation)possibleParamsArray).Bounds is [BoundLiteral { ConstantValueOpt.Value: 0 }]) 1261if (paramsArray is BoundArrayCreation { Bounds: [BoundLiteral] bounds, InitializerOpt: BoundArrayInitialization { Initializers: var elements } initialization } creation)
Lowering\LocalRewriter\LocalRewriter_CollectionExpression.cs (1)
1260var otherElements = _factory.Literal(initialLength);
Lowering\LocalRewriter\LocalRewriter_Literal.cs (2)
17public override BoundNode VisitLiteral(BoundLiteral node) 23private BoundExpression MakeLiteral(SyntaxNode syntax, ConstantValue constantValue, TypeSymbol? type, BoundLiteral? oldNodeOpt = null)
Lowering\LocalRewriter\LocalRewriter_StringInterpolation.cs (1)
177Debug.Assert(part is BoundLiteral && part.ConstantValueOpt?.StringValue is not null);
Lowering\SyntheticBoundNodeFactory.cs (12)
708public BoundLiteral Literal(byte value) 713public BoundLiteral Literal(int value) 718public BoundLiteral Literal(StateMachineState value) 721public BoundLiteral Literal(uint value) 726public BoundLiteral Literal(ConstantValue value, TypeSymbol type) 1125public BoundLiteral Literal(Boolean value) 1130public BoundLiteral Literal(string? value) 1136public BoundLiteral StringLiteral(ConstantValue stringConst) 1142public BoundLiteral StringLiteral(String stringValue) 1147public BoundLiteral CharLiteral(ConstantValue charConst) 1153public BoundLiteral CharLiteral(Char charValue) 1862var whenNull = kind == BinaryOperatorKind.NullableNullEqual ? Literal(true) : null;
Operations\CSharpOperationFactory.cs (8)
58return CreateBoundLiteralOperation((BoundLiteral)boundNode); 674internal ILiteralOperation CreateBoundLiteralOperation(BoundLiteral boundLiteral, bool @implicit = false) 1017Debug.Assert(!forceOperandImplicitLiteral || boundConversion.Operand is BoundLiteral); 1132? CreateBoundLiteralOperation((BoundLiteral)correctedConversionNode.Operand, @implicit: true) 2286builder.Add(CreateBoundInterpolatedStringTextOperation((BoundLiteral)part)); 2354BoundLiteral l => CreateBoundLiteralOperation(l, @implicit: true), 2355BoundConversion { Operand: BoundLiteral } c => CreateBoundConversionOperation(c, forceOperandImplicitLiteral: true), 2409private IInterpolatedStringTextOperation CreateBoundInterpolatedStringTextOperation(BoundLiteral boundNode)
Symbols\ReducedExtensionMethodSymbol.cs (3)
144var thisArgumentValue = new BoundLiteral(syntax, ConstantValue.Bad, thisType) { WasCompilerGenerated = true }; 146var otherArgumentValue = new BoundLiteral(syntax, ConstantValue.Bad, otherArgumentType) { WasCompilerGenerated = true }; 153var argument = (i == 0) ? thisArgumentValue : otherArgumentValue;
Symbols\Synthesized\Records\SynthesizedRecordGetHashCode.cs (1)
92BoundLiteral? boundHashFactor = null;