48 references to Literal
Microsoft.Analyzers.Extra (1)
CallAnalysis\Fixers\LegacyLoggingFixer.FixDetails.cs (1)
106var op = invocationOp.Arguments[LogLevelParamIndex].Descendants().SingleOrDefault(x => x.Kind == OperationKind.Literal || x.Kind == OperationKind.FieldReference);
Microsoft.AspNetCore.Mvc.Api.Analyzers (1)
ApiActionsDoNotRequireExplicitModelValidationCheckAnalyzer.cs (1)
164if (operation.Kind != OperationKind.Literal)
Microsoft.CodeAnalysis (3)
Generated\Operations.Generated.cs (2)
678/// <item><description><see cref="OperationKind.Literal"/></description></item> 5088public override OperationKind Kind => OperationKind.Literal;
Operations\ControlFlowGraphBuilder.cs (1)
6063var validKinds = ImmutableArray.Create(OperationKind.Invocation, OperationKind.DynamicInvocation, OperationKind.Increment, OperationKind.Literal,
Microsoft.CodeAnalysis.CodeStyle (4)
src\Analyzers\Core\Analyzers\RemoveRedundantEquality\AbstractRemoveRedundantEqualityDiagnosticAnalyzer.cs (1)
126Kind: OperationKind.Literal,
src\Analyzers\Core\Analyzers\SimplifyInterpolation\AbstractSimplifyInterpolationHelpers.cs (1)
212: alignmentOp is { Kind: OperationKind.Literal })
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\OperationExtensions.cs (1)
375=> operation.Kind == OperationKind.Literal && operation.Type.IsNumericType();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\SymbolUsageAnalysis\SymbolUsageAnalysis.Walker.cs (1)
484case OperationKind.Literal:
Microsoft.CodeAnalysis.CodeStyle.Fixes (2)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxGeneratorExtensions_Negate.cs (2)
479if (operation?.Kind == OperationKind.Literal && operation.ConstantValue.HasValue && operation.ConstantValue.Value is true) 483else if (operation?.Kind == OperationKind.Literal && operation.ConstantValue.HasValue && operation.ConstantValue.Value is false)
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (6)
Diagnostics\GetDiagnosticsTests.cs (1)
984OperationKind.Literal);
Semantics\PrimaryConstructorTests.cs (3)
4316context.RegisterOperationAction(Handle3, OperationKind.Literal); 4709context.RegisterOperationAction(Handle3, OperationKind.Literal); 5684context.RegisterOperationAction(HandleLiteral, OperationKind.Literal);
Semantics\RecordTests.cs (2)
26824context.RegisterOperationAction(Handle3, OperationKind.Literal); 27217context.RegisterOperationAction(Handle3, OperationKind.Literal);
Microsoft.CodeAnalysis.CSharp.IOperation.UnitTests (4)
IOperation\IOperationTests_IVariableDeclaration.cs (4)
614Assert.Equal(OperationKind.Literal, declarator.ChildOperations.First().Kind); 636Assert.Equal(OperationKind.Literal, declarator.ChildOperations.First().Kind); 852Assert.Equal(OperationKind.Literal, declaration.ChildOperations.First().Kind); 874Assert.Equal(OperationKind.Literal, declaration.ChildOperations.First().Kind);
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (2)
Semantics\RecordStructTests.cs (1)
6410context.RegisterOperationAction(HandleLiteral, OperationKind.Literal);
Semantics\TopLevelStatementsTests.cs (1)
9681Assert.Equal(OperationKind.Literal, model.GetOperation(tree.GetRoot().DescendantNodes().OfType<LiteralExpressionSyntax>().Single()).Kind);
Microsoft.CodeAnalysis.Features (2)
src\Analyzers\Core\Analyzers\RemoveRedundantEquality\AbstractRemoveRedundantEqualityDiagnosticAnalyzer.cs (1)
126Kind: OperationKind.Literal,
src\Analyzers\Core\Analyzers\SimplifyInterpolation\AbstractSimplifyInterpolationHelpers.cs (1)
212: alignmentOp is { Kind: OperationKind.Literal })
Microsoft.CodeAnalysis.Test.Utilities (18)
Compilation\ControlFlowGraphVerifier.cs (1)
1908case OperationKind.Literal:
Compilation\OperationTreeVerifier.cs (4)
1911if (operation.Text.Kind != OperationKind.Literal) 1913Assert.Equal(OperationKind.Literal, ((IConversionOperation)operation.Text).Operand.Kind); 1927if (operation.FormatString != null && operation.FormatString.Kind != OperationKind.Literal) 1929Assert.Equal(OperationKind.Literal, ((IConversionOperation)operation.FormatString).Operand.Kind);
Compilation\TestOperationVisitor.cs (5)
978Assert.Equal(OperationKind.Literal, operation.Kind); 1290if (operation.Text.Kind != OperationKind.Literal) 1292Assert.Equal(OperationKind.Literal, ((IConversionOperation)operation.Text).Operand.Kind); 1308if (operation.FormatString.Kind != OperationKind.Literal) 1310Assert.Equal(OperationKind.Literal, ((IConversionOperation)operation.FormatString).Operand.Kind);
Diagnostics\CommonDiagnosticAnalyzers.cs (2)
1355}, OperationKind.Literal); 1367}, OperationKind.Literal);
Diagnostics\OperationTestAnalyzer.cs (6)
113OperationKind.Literal); 638OperationKind.Literal); 1620if (right.Kind == OperationKind.Literal) 2054OperationKind.Literal); 2082OperationKind.Literal); 2113OperationKind.Literal);
Microsoft.CodeAnalysis.VisualBasic.Semantic.UnitTests (1)
Diagnostics\GetDiagnosticsTests.vb (1)
613blockStartContext.RegisterOperationAction(AddressOf AnalyzeOperationContext, OperationKind.Literal)
Microsoft.CodeAnalysis.Workspaces (4)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\OperationExtensions.cs (1)
375=> operation.Kind == OperationKind.Literal && operation.Type.IsNumericType();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\SymbolUsageAnalysis\SymbolUsageAnalysis.Walker.cs (1)
484case OperationKind.Literal:
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxGeneratorExtensions_Negate.cs (2)
479if (operation?.Kind == OperationKind.Literal && operation.ConstantValue.HasValue && operation.ConstantValue.Value is true) 483else if (operation?.Kind == OperationKind.Literal && operation.ConstantValue.HasValue && operation.ConstantValue.Value is false)