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