155 references to NullLiteralExpression
Microsoft.CodeAnalysis.CSharp (5)
Binder\Binder_Expressions.cs (1)
707
case SyntaxKind.
NullLiteralExpression
:
Binder\EarlyWellKnownAttributeBinder.cs (1)
88
case SyntaxKind.
NullLiteralExpression
:
Parser\LanguageParser.cs (1)
10858
case SyntaxKind.
NullLiteralExpression
:
Syntax\LiteralExpressionSyntax.cs (1)
26
SyntaxKind.
NullLiteralExpression
=> SyntaxKind.NullKeyword,
Syntax\SyntaxKindFacts.cs (1)
581
SyntaxKind.NullKeyword => SyntaxKind.
NullLiteralExpression
,
Microsoft.CodeAnalysis.CSharp.CodeStyle (21)
src\Analyzers\CSharp\Analyzers\InvokeDelegateWithConditionalAccess\InvokeDelegateWithConditionalAccessAnalyzer.cs (4)
120
if (condition.Left.IsKind(SyntaxKind.
NullLiteralExpression
) ||
121
condition.Right.IsKind(SyntaxKind.
NullLiteralExpression
))
123
var expr = condition.Left.IsKind(SyntaxKind.
NullLiteralExpression
)
310
=> left.IsKind(SyntaxKind.IdentifierName) && right.IsKind(SyntaxKind.
NullLiteralExpression
);
src\Analyzers\CSharp\Analyzers\UseCoalesceExpression\CSharpUseCoalesceExpressionForIfNullStatementCheckDiagnosticAnalyzer.cs (2)
43
if (condition is BinaryExpressionSyntax(SyntaxKind.EqualsExpression) { Right: LiteralExpressionSyntax(SyntaxKind.
NullLiteralExpression
) } binary)
48
else if (condition is IsPatternExpressionSyntax { Pattern: ConstantPatternSyntax { Expression: LiteralExpressionSyntax(SyntaxKind.
NullLiteralExpression
) } } isPattern)
src\Analyzers\CSharp\Analyzers\UseCompoundAssignment\CSharpUseCompoundCoalesceAssignmentDiagnosticAnalyzer.cs (5)
184
if (condition is BinaryExpressionSyntax(SyntaxKind.EqualsExpression) { Right: LiteralExpressionSyntax(SyntaxKind.
NullLiteralExpression
) } binaryExpression)
193
else if (condition is IsPatternExpressionSyntax { Pattern: ConstantPatternSyntax { Expression: LiteralExpressionSyntax(SyntaxKind.
NullLiteralExpression
) } } isPattern)
203
if (arg0.Kind() == SyntaxKind.
NullLiteralExpression
||
204
arg1.Kind() == SyntaxKind.
NullLiteralExpression
)
210
testedExpression = arg0.Kind() == SyntaxKind.
NullLiteralExpression
? arg1 : arg0;
src\Analyzers\CSharp\Analyzers\UseIsNullCheck\CSharpUseIsNullCheckForCastAndEqualityOperatorDiagnosticAnalyzer.cs (1)
73
right.IsKind(SyntaxKind.
NullLiteralExpression
))
src\Analyzers\CSharp\Analyzers\UseLocalFunction\CSharpUseLocalFunctionDiagnosticAnalyzer.cs (1)
369
SyntaxKind.
NullLiteralExpression
or
src\Analyzers\CSharp\Analyzers\UsePatternMatching\CSharpAsAndNullCheckDiagnosticAnalyzer.cs (3)
329
if (left.IsKind(SyntaxKind.
NullLiteralExpression
))
336
if (right.IsKind(SyntaxKind.
NullLiteralExpression
))
352
&& constantPattern.Expression.IsKind(SyntaxKind.
NullLiteralExpression
)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SyntaxFacts\CSharpSyntaxKinds.cs (1)
86
public int NullLiteralExpression => (int)SyntaxKind.
NullLiteralExpression
;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Simplification\Simplifiers\CastSimplifier.cs (2)
333
var isNullLiteralCast = castedExpressionNode.WalkDownParentheses().IsKind(SyntaxKind.
NullLiteralExpression
);
1016
if (otherSide.WalkDownParentheses().Kind() == SyntaxKind.
NullLiteralExpression
)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\SpeculationAnalyzer.cs (1)
467
if (previousReplacedExpression.WalkDownParentheses().Kind() is SyntaxKind.
NullLiteralExpression
or SyntaxKind.DefaultLiteralExpression)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\TypeStyle\CSharpUseImplicitTypeHelper.cs (1)
264
if (expression.IsKind(SyntaxKind.
NullLiteralExpression
))
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (8)
src\Analyzers\CSharp\CodeFixes\ConvertToRecord\ConvertToRecordHelpers.cs (1)
414
? SyntaxKind.
NullLiteralExpression
src\Analyzers\CSharp\CodeFixes\Nullable\CSharpDeclareAsNullableCodeFixProvider.cs (1)
317
SyntaxKind.
NullLiteralExpression
or
src\Analyzers\CSharp\CodeFixes\UseCollectionExpression\CSharpCollectionExpressionRewriter.cs (1)
107
[LiteralExpression(SyntaxKind.
NullLiteralExpression
, NullKeyword.WithAdditionalAnnotations(nullTokenAnnotation))],
src\Analyzers\CSharp\CodeFixes\UseIsNullCheck\CSharpUseIsNullCheckForCastAndEqualityOperatorCodeFixProvider.cs (1)
95
=> binary.Right.IsKind(SyntaxKind.
NullLiteralExpression
)
src\Analyzers\CSharp\CodeFixes\UseIsNullCheck\CSharpUseIsNullCheckForReferenceEqualsCodeFixProvider.cs (1)
25
= LiteralExpression(SyntaxKind.
NullLiteralExpression
);
src\Analyzers\CSharp\CodeFixes\UseIsNullCheck\CSharpUseNullCheckOverTypeCheckCodeFixProvider.cs (1)
27
private static readonly ConstantPatternSyntax s_nullConstantPattern = ConstantPattern(LiteralExpression(SyntaxKind.
NullLiteralExpression
));
src\Analyzers\CSharp\CodeFixes\UsePatternCombinators\CSharpUsePatternCombinatorsCodeFixProvider.cs (1)
121
if (expr.IsKind(SyntaxKind.
NullLiteralExpression
))
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\ExpressionGenerator.cs (1)
52
=> LiteralExpression(SyntaxKind.
NullLiteralExpression
);
Microsoft.CodeAnalysis.CSharp.Features (30)
CodeRefactorings\UseRecursivePatterns\UseRecursivePatternsCodeRefactoringProvider.cs (2)
507
if (binaryExpression.Left.Kind() ==
NullLiteralExpression
|| binaryExpression.Right.Kind() ==
NullLiteralExpression
)
ConvertCast\CSharpConvertTryCastToDirectCastCodeRefactoringProvider.cs (1)
59
if (expression.IsKind(SyntaxKind.
NullLiteralExpression
) && nullableContext.HasFlag(NullableContext.AnnotationsEnabled) && isReferenceType)
Debugging\CSharpProximityExpressionsService_ExpressionTermCollector.cs (1)
79
case SyntaxKind.
NullLiteralExpression
:
DocumentationComments\CSharpDocumentationCommentSnippetService.cs (1)
164
if (expression.IsKind(SyntaxKind.
NullLiteralExpression
))
EditAndContinue\SyntaxComparer.cs (1)
526
case SyntaxKind.
NullLiteralExpression
:
IntroduceVariable\CSharpIntroduceVariableService.cs (1)
120
if (expression.IsKind(SyntaxKind.
NullLiteralExpression
))
src\Analyzers\CSharp\Analyzers\InvokeDelegateWithConditionalAccess\InvokeDelegateWithConditionalAccessAnalyzer.cs (4)
120
if (condition.Left.IsKind(SyntaxKind.
NullLiteralExpression
) ||
121
condition.Right.IsKind(SyntaxKind.
NullLiteralExpression
))
123
var expr = condition.Left.IsKind(SyntaxKind.
NullLiteralExpression
)
310
=> left.IsKind(SyntaxKind.IdentifierName) && right.IsKind(SyntaxKind.
NullLiteralExpression
);
src\Analyzers\CSharp\Analyzers\UseCoalesceExpression\CSharpUseCoalesceExpressionForIfNullStatementCheckDiagnosticAnalyzer.cs (2)
43
if (condition is BinaryExpressionSyntax(SyntaxKind.EqualsExpression) { Right: LiteralExpressionSyntax(SyntaxKind.
NullLiteralExpression
) } binary)
48
else if (condition is IsPatternExpressionSyntax { Pattern: ConstantPatternSyntax { Expression: LiteralExpressionSyntax(SyntaxKind.
NullLiteralExpression
) } } isPattern)
src\Analyzers\CSharp\Analyzers\UseCompoundAssignment\CSharpUseCompoundCoalesceAssignmentDiagnosticAnalyzer.cs (5)
184
if (condition is BinaryExpressionSyntax(SyntaxKind.EqualsExpression) { Right: LiteralExpressionSyntax(SyntaxKind.
NullLiteralExpression
) } binaryExpression)
193
else if (condition is IsPatternExpressionSyntax { Pattern: ConstantPatternSyntax { Expression: LiteralExpressionSyntax(SyntaxKind.
NullLiteralExpression
) } } isPattern)
203
if (arg0.Kind() == SyntaxKind.
NullLiteralExpression
||
204
arg1.Kind() == SyntaxKind.
NullLiteralExpression
)
210
testedExpression = arg0.Kind() == SyntaxKind.
NullLiteralExpression
? arg1 : arg0;
src\Analyzers\CSharp\Analyzers\UseIsNullCheck\CSharpUseIsNullCheckForCastAndEqualityOperatorDiagnosticAnalyzer.cs (1)
73
right.IsKind(SyntaxKind.
NullLiteralExpression
))
src\Analyzers\CSharp\Analyzers\UseLocalFunction\CSharpUseLocalFunctionDiagnosticAnalyzer.cs (1)
369
SyntaxKind.
NullLiteralExpression
or
src\Analyzers\CSharp\Analyzers\UsePatternMatching\CSharpAsAndNullCheckDiagnosticAnalyzer.cs (3)
329
if (left.IsKind(SyntaxKind.
NullLiteralExpression
))
336
if (right.IsKind(SyntaxKind.
NullLiteralExpression
))
352
&& constantPattern.Expression.IsKind(SyntaxKind.
NullLiteralExpression
)
src\Analyzers\CSharp\CodeFixes\ConvertToRecord\ConvertToRecordHelpers.cs (1)
414
? SyntaxKind.
NullLiteralExpression
src\Analyzers\CSharp\CodeFixes\Nullable\CSharpDeclareAsNullableCodeFixProvider.cs (1)
317
SyntaxKind.
NullLiteralExpression
or
src\Analyzers\CSharp\CodeFixes\UseCollectionExpression\CSharpCollectionExpressionRewriter.cs (1)
107
[LiteralExpression(SyntaxKind.
NullLiteralExpression
, NullKeyword.WithAdditionalAnnotations(nullTokenAnnotation))],
src\Analyzers\CSharp\CodeFixes\UseIsNullCheck\CSharpUseIsNullCheckForCastAndEqualityOperatorCodeFixProvider.cs (1)
95
=> binary.Right.IsKind(SyntaxKind.
NullLiteralExpression
)
src\Analyzers\CSharp\CodeFixes\UseIsNullCheck\CSharpUseIsNullCheckForReferenceEqualsCodeFixProvider.cs (1)
25
= LiteralExpression(SyntaxKind.
NullLiteralExpression
);
src\Analyzers\CSharp\CodeFixes\UseIsNullCheck\CSharpUseNullCheckOverTypeCheckCodeFixProvider.cs (1)
27
private static readonly ConstantPatternSyntax s_nullConstantPattern = ConstantPattern(LiteralExpression(SyntaxKind.
NullLiteralExpression
));
src\Analyzers\CSharp\CodeFixes\UsePatternCombinators\CSharpUsePatternCombinatorsCodeFixProvider.cs (1)
121
if (expr.IsKind(SyntaxKind.
NullLiteralExpression
))
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (73)
Parsing\AsyncParsingTests.cs (7)
2413
N(SyntaxKind.
NullLiteralExpression
);
2516
N(SyntaxKind.
NullLiteralExpression
);
2637
N(SyntaxKind.
NullLiteralExpression
);
2685
N(SyntaxKind.
NullLiteralExpression
);
2734
N(SyntaxKind.
NullLiteralExpression
);
2781
N(SyntaxKind.
NullLiteralExpression
);
2835
N(SyntaxKind.
NullLiteralExpression
);
Parsing\AwaitParsingTests.cs (1)
2302
N(SyntaxKind.
NullLiteralExpression
);
Parsing\DeclarationScopeParsingTests.cs (4)
923
N(SyntaxKind.
NullLiteralExpression
);
989
N(SyntaxKind.
NullLiteralExpression
);
1127
N(SyntaxKind.
NullLiteralExpression
);
1252
N(SyntaxKind.
NullLiteralExpression
);
Parsing\ExpressionParsingTests.cs (2)
6872
N(SyntaxKind.
NullLiteralExpression
);
6934
N(SyntaxKind.
NullLiteralExpression
);
Parsing\FieldKeywordParsingTests.cs (1)
644
N(SyntaxKind.
NullLiteralExpression
);
Parsing\FunctionPointerTests.cs (1)
3016
N(SyntaxKind.
NullLiteralExpression
);
Parsing\LambdaParameterParsingTests.cs (9)
2251
N(SyntaxKind.
NullLiteralExpression
);
2345
N(SyntaxKind.
NullLiteralExpression
);
2465
N(SyntaxKind.
NullLiteralExpression
);
2535
N(SyntaxKind.
NullLiteralExpression
);
2615
N(SyntaxKind.
NullLiteralExpression
);
4378
N(SyntaxKind.
NullLiteralExpression
);
4445
N(SyntaxKind.
NullLiteralExpression
);
4524
N(SyntaxKind.
NullLiteralExpression
);
4744
N(SyntaxKind.
NullLiteralExpression
);
Parsing\LambdaReturnTypeParsingTests.cs (17)
443
N(SyntaxKind.
NullLiteralExpression
);
686
N(SyntaxKind.
NullLiteralExpression
);
761
N(SyntaxKind.
NullLiteralExpression
);
849
N(SyntaxKind.
NullLiteralExpression
);
2059
N(SyntaxKind.
NullLiteralExpression
);
2098
N(SyntaxKind.
NullLiteralExpression
);
2132
N(SyntaxKind.
NullLiteralExpression
);
2167
N(SyntaxKind.
NullLiteralExpression
);
2215
N(SyntaxKind.
NullLiteralExpression
);
2405
N(SyntaxKind.
NullLiteralExpression
);
3169
N(SyntaxKind.
NullLiteralExpression
);
3212
N(SyntaxKind.
NullLiteralExpression
);
3233
N(SyntaxKind.
NullLiteralExpression
);
3281
N(SyntaxKind.
NullLiteralExpression
);
3459
N(SyntaxKind.
NullLiteralExpression
);
3515
N(SyntaxKind.
NullLiteralExpression
);
5036
N(SyntaxKind.
NullLiteralExpression
);
Parsing\MemberDeclarationParsingTests.cs (7)
17209
N(SyntaxKind.
NullLiteralExpression
);
17406
N(SyntaxKind.
NullLiteralExpression
);
17536
N(SyntaxKind.
NullLiteralExpression
);
17610
N(SyntaxKind.
NullLiteralExpression
);
17753
N(SyntaxKind.
NullLiteralExpression
);
17827
N(SyntaxKind.
NullLiteralExpression
);
18963
N(SyntaxKind.
NullLiteralExpression
);
Parsing\NullableParsingTests.cs (3)
123
N(SyntaxKind.
NullLiteralExpression
);
262
N(SyntaxKind.
NullLiteralExpression
);
324
N(SyntaxKind.
NullLiteralExpression
);
Parsing\PatternParsingTests.cs (12)
208
N(SyntaxKind.
NullLiteralExpression
);
632
N(SyntaxKind.
NullLiteralExpression
);
689
N(SyntaxKind.
NullLiteralExpression
);
719
N(SyntaxKind.
NullLiteralExpression
);
749
N(SyntaxKind.
NullLiteralExpression
);
779
N(SyntaxKind.
NullLiteralExpression
);
857
N(SyntaxKind.
NullLiteralExpression
);
874
N(SyntaxKind.
NullLiteralExpression
);
891
N(SyntaxKind.
NullLiteralExpression
);
908
N(SyntaxKind.
NullLiteralExpression
);
8460
N(SyntaxKind.
NullLiteralExpression
);
8615
N(SyntaxKind.
NullLiteralExpression
);
Parsing\StatementAttributeParsingTests.cs (4)
1375
N(SyntaxKind.
NullLiteralExpression
);
1452
N(SyntaxKind.
NullLiteralExpression
);
1539
N(SyntaxKind.
NullLiteralExpression
);
2132
N(SyntaxKind.
NullLiteralExpression
);
Parsing\StatementParsingTests.cs (1)
2745
N(SyntaxKind.
NullLiteralExpression
);
Parsing\SuppressNullableWarningExpressionParsingTests.cs (3)
56
N(SyntaxKind.
NullLiteralExpression
);
170
N(SyntaxKind.
NullLiteralExpression
);
214
N(SyntaxKind.
NullLiteralExpression
);
Syntax\SyntaxTests.cs (1)
238
[InlineData(SyntaxKind.NullKeyword, SyntaxKind.
NullLiteralExpression
)]
Microsoft.CodeAnalysis.CSharp.Workspaces (7)
CodeGeneration\CSharpSyntaxGenerator.cs (1)
3235
return SyntaxFactory.LiteralExpression(SyntaxKind.
NullLiteralExpression
);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SyntaxFacts\CSharpSyntaxKinds.cs (1)
86
public int NullLiteralExpression => (int)SyntaxKind.
NullLiteralExpression
;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Simplification\Simplifiers\CastSimplifier.cs (2)
333
var isNullLiteralCast = castedExpressionNode.WalkDownParentheses().IsKind(SyntaxKind.
NullLiteralExpression
);
1016
if (otherSide.WalkDownParentheses().Kind() == SyntaxKind.
NullLiteralExpression
)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\SpeculationAnalyzer.cs (1)
467
if (previousReplacedExpression.WalkDownParentheses().Kind() is SyntaxKind.
NullLiteralExpression
or SyntaxKind.DefaultLiteralExpression)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\TypeStyle\CSharpUseImplicitTypeHelper.cs (1)
264
if (expression.IsKind(SyntaxKind.
NullLiteralExpression
))
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\ExpressionGenerator.cs (1)
52
=> LiteralExpression(SyntaxKind.
NullLiteralExpression
);
Microsoft.CodeAnalysis.CSharp.Workspaces.UnitTests (3)
CodeGeneration\SyntaxGeneratorTests.cs (3)
1323
SyntaxKind.
NullLiteralExpression
))
1452
SyntaxKind.
NullLiteralExpression
)))
1460
SyntaxKind.
NullLiteralExpression
)))
Microsoft.Interop.ComInterfaceGenerator (3)
ComClassGenerator.cs (1)
181
LiteralExpression(SyntaxKind.
NullLiteralExpression
)),
ComInterfaceGenerator.cs (2)
665
LiteralExpression(SyntaxKind.
NullLiteralExpression
)),
679
.WithExpressionBody(ArrowExpressionClause(LiteralExpression(SyntaxKind.
NullLiteralExpression
)))
Microsoft.Interop.JavaScript.JSImportGenerator (2)
JSImportCodeGenerator.cs (2)
142
? LiteralExpression(SyntaxKind.
NullLiteralExpression
)
147
statementsToUpdate.Add(IfStatement(BinaryExpression(SyntaxKind.EqualsExpression, IdentifierName(_signatureContext.BindingName), LiteralExpression(SyntaxKind.
NullLiteralExpression
)),
Microsoft.Interop.SourceGeneration (2)
Marshalling\DelegateMarshaller.cs (2)
48
LiteralExpression(SyntaxKind.
NullLiteralExpression
)
76
LiteralExpression(SyntaxKind.
NullLiteralExpression
)));
Microsoft.VisualStudio.LanguageServices.CSharp (1)
CodeModel\MethodXml\MethodXmlBuilder.cs (1)
176
case SyntaxKind.
NullLiteralExpression
: