145 references to NullLiteralExpression
Microsoft.CodeAnalysis.CSharp (5)
Binder\Binder_Expressions.cs (1)
675case SyntaxKind.NullLiteralExpression:
Binder\EarlyWellKnownAttributeBinder.cs (1)
88case SyntaxKind.NullLiteralExpression:
Parser\LanguageParser.cs (1)
10175case SyntaxKind.NullLiteralExpression:
Syntax\LiteralExpressionSyntax.cs (1)
26SyntaxKind.NullLiteralExpression => SyntaxKind.NullKeyword,
Syntax\SyntaxKindFacts.cs (1)
553SyntaxKind.NullKeyword => SyntaxKind.NullLiteralExpression,
Microsoft.CodeAnalysis.CSharp.CodeStyle (21)
CastSimplifier.cs (2)
315var isNullLiteralCast = castedExpressionNode.WalkDownParentheses().IsKind(SyntaxKind.NullLiteralExpression); 869if (otherSide.WalkDownParentheses().Kind() == SyntaxKind.NullLiteralExpression)
CSharpAsAndNullCheckDiagnosticAnalyzer.cs (3)
328if (left.IsKind(SyntaxKind.NullLiteralExpression)) 335if (right.IsKind(SyntaxKind.NullLiteralExpression)) 351&& constantPattern.Expression.IsKind(SyntaxKind.NullLiteralExpression)
CSharpSyntaxKinds.cs (1)
75public int NullLiteralExpression => (int)SyntaxKind.NullLiteralExpression;
CSharpUseCoalesceExpressionForIfNullStatementCheckDiagnosticAnalyzer.cs (2)
45if (condition is BinaryExpressionSyntax(SyntaxKind.EqualsExpression) { Right: LiteralExpressionSyntax(SyntaxKind.NullLiteralExpression) } binary) 50else if (condition is IsPatternExpressionSyntax { Pattern: ConstantPatternSyntax { Expression: LiteralExpressionSyntax(SyntaxKind.NullLiteralExpression) } } isPattern)
CSharpUseCompoundCoalesceAssignmentDiagnosticAnalyzer.cs (5)
191if (condition is BinaryExpressionSyntax(SyntaxKind.EqualsExpression) { Right: LiteralExpressionSyntax(SyntaxKind.NullLiteralExpression) } binaryExpression) 200else if (condition is IsPatternExpressionSyntax { Pattern: ConstantPatternSyntax { Expression: LiteralExpressionSyntax(SyntaxKind.NullLiteralExpression) } } isPattern) 210if (arg0.Kind() == SyntaxKind.NullLiteralExpression || 211arg1.Kind() == SyntaxKind.NullLiteralExpression) 217testedExpression = arg0.Kind() == SyntaxKind.NullLiteralExpression ? arg1 : arg0;
CSharpUseImplicitTypeHelper.cs (1)
281if (expression.IsKind(SyntaxKind.NullLiteralExpression))
CSharpUseIsNullCheckForCastAndEqualityOperatorDiagnosticAnalyzer.cs (1)
74right.IsKind(SyntaxKind.NullLiteralExpression))
CSharpUseLocalFunctionDiagnosticAnalyzer.cs (1)
334SyntaxKind.NullLiteralExpression or
InvokeDelegateWithConditionalAccessAnalyzer.cs (4)
122if (condition.Left.IsKind(SyntaxKind.NullLiteralExpression) || 123condition.Right.IsKind(SyntaxKind.NullLiteralExpression)) 125var expr = condition.Left.IsKind(SyntaxKind.NullLiteralExpression) 333=> left.IsKind(SyntaxKind.IdentifierName) && right.IsKind(SyntaxKind.NullLiteralExpression);
SpeculationAnalyzer.cs (1)
454if (previousReplacedExpression.WalkDownParentheses().Kind() is SyntaxKind.NullLiteralExpression or SyntaxKind.DefaultLiteralExpression)
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (7)
ConvertToRecordHelpers.cs (1)
412? SyntaxKind.NullLiteralExpression
CSharpDeclareAsNullableCodeFixProvider.cs (1)
335SyntaxKind.NullLiteralExpression or
CSharpUseIsNullCheckForCastAndEqualityOperatorCodeFixProvider.cs (1)
99=> binary.Right.IsKind(SyntaxKind.NullLiteralExpression)
CSharpUseIsNullCheckForReferenceEqualsCodeFixProvider.cs (1)
24= LiteralExpression(SyntaxKind.NullLiteralExpression);
CSharpUseNullCheckOverTypeCheckCodeFixProvider.cs (1)
27private static readonly ConstantPatternSyntax s_nullConstantPattern = ConstantPattern(LiteralExpression(SyntaxKind.NullLiteralExpression));
CSharpUsePatternCombinatorsCodeFixProvider.cs (1)
127if (expr.IsKind(SyntaxKind.NullLiteralExpression))
ExpressionGenerator.cs (1)
51=> SyntaxFactory.LiteralExpression(SyntaxKind.NullLiteralExpression);
Microsoft.CodeAnalysis.CSharp.Features (27)
ConvertCast\CSharpConvertTryCastToDirectCastCodeRefactoringProvider.cs (1)
57if (expression.IsKind(SyntaxKind.NullLiteralExpression) && nullableContext.HasFlag(NullableContext.AnnotationsEnabled) && isReferenceType)
ConvertToRecordHelpers.cs (1)
412? SyntaxKind.NullLiteralExpression
CSharpAsAndNullCheckDiagnosticAnalyzer.cs (3)
328if (left.IsKind(SyntaxKind.NullLiteralExpression)) 335if (right.IsKind(SyntaxKind.NullLiteralExpression)) 351&& constantPattern.Expression.IsKind(SyntaxKind.NullLiteralExpression)
CSharpDeclareAsNullableCodeFixProvider.cs (1)
335SyntaxKind.NullLiteralExpression or
CSharpUseCoalesceExpressionForIfNullStatementCheckDiagnosticAnalyzer.cs (2)
45if (condition is BinaryExpressionSyntax(SyntaxKind.EqualsExpression) { Right: LiteralExpressionSyntax(SyntaxKind.NullLiteralExpression) } binary) 50else if (condition is IsPatternExpressionSyntax { Pattern: ConstantPatternSyntax { Expression: LiteralExpressionSyntax(SyntaxKind.NullLiteralExpression) } } isPattern)
CSharpUseCompoundCoalesceAssignmentDiagnosticAnalyzer.cs (5)
191if (condition is BinaryExpressionSyntax(SyntaxKind.EqualsExpression) { Right: LiteralExpressionSyntax(SyntaxKind.NullLiteralExpression) } binaryExpression) 200else if (condition is IsPatternExpressionSyntax { Pattern: ConstantPatternSyntax { Expression: LiteralExpressionSyntax(SyntaxKind.NullLiteralExpression) } } isPattern) 210if (arg0.Kind() == SyntaxKind.NullLiteralExpression || 211arg1.Kind() == SyntaxKind.NullLiteralExpression) 217testedExpression = arg0.Kind() == SyntaxKind.NullLiteralExpression ? arg1 : arg0;
CSharpUseIsNullCheckForCastAndEqualityOperatorCodeFixProvider.cs (1)
99=> binary.Right.IsKind(SyntaxKind.NullLiteralExpression)
CSharpUseIsNullCheckForCastAndEqualityOperatorDiagnosticAnalyzer.cs (1)
74right.IsKind(SyntaxKind.NullLiteralExpression))
CSharpUseIsNullCheckForReferenceEqualsCodeFixProvider.cs (1)
24= LiteralExpression(SyntaxKind.NullLiteralExpression);
CSharpUseLocalFunctionDiagnosticAnalyzer.cs (1)
334SyntaxKind.NullLiteralExpression or
CSharpUseNullCheckOverTypeCheckCodeFixProvider.cs (1)
27private static readonly ConstantPatternSyntax s_nullConstantPattern = ConstantPattern(LiteralExpression(SyntaxKind.NullLiteralExpression));
CSharpUsePatternCombinatorsCodeFixProvider.cs (1)
127if (expr.IsKind(SyntaxKind.NullLiteralExpression))
Debugging\CSharpProximityExpressionsService_ExpressionTermCollector.cs (1)
79case SyntaxKind.NullLiteralExpression:
DocumentationComments\CSharpDocumentationCommentSnippetService.cs (1)
166if (expression.IsKind(SyntaxKind.NullLiteralExpression))
EditAndContinue\SyntaxComparer.cs (1)
525case SyntaxKind.NullLiteralExpression:
IntroduceVariable\CSharpIntroduceVariableService.cs (1)
120if (expression.IsKind(SyntaxKind.NullLiteralExpression))
InvokeDelegateWithConditionalAccessAnalyzer.cs (4)
122if (condition.Left.IsKind(SyntaxKind.NullLiteralExpression) || 123condition.Right.IsKind(SyntaxKind.NullLiteralExpression)) 125var expr = condition.Left.IsKind(SyntaxKind.NullLiteralExpression) 333=> left.IsKind(SyntaxKind.IdentifierName) && right.IsKind(SyntaxKind.NullLiteralExpression);
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (74)
Parsing\AsyncParsingTests.cs (3)
2424N(SyntaxKind.NullLiteralExpression); 2527N(SyntaxKind.NullLiteralExpression); 2648N(SyntaxKind.NullLiteralExpression);
Parsing\AwaitParsingTests.cs (1)
1609N(SyntaxKind.NullLiteralExpression);
Parsing\DeclarationParsingTests.cs (13)
7386N(SyntaxKind.NullLiteralExpression); 7429N(SyntaxKind.NullLiteralExpression); 7629N(SyntaxKind.NullLiteralExpression); 7767N(SyntaxKind.NullLiteralExpression); 7810N(SyntaxKind.NullLiteralExpression); 7853N(SyntaxKind.NullLiteralExpression); 7896N(SyntaxKind.NullLiteralExpression); 7939N(SyntaxKind.NullLiteralExpression); 7983N(SyntaxKind.NullLiteralExpression); 8026N(SyntaxKind.NullLiteralExpression); 8070N(SyntaxKind.NullLiteralExpression); 8114N(SyntaxKind.NullLiteralExpression); 8168N(SyntaxKind.NullLiteralExpression);
Parsing\DeclarationScopeParsingTests.cs (4)
942N(SyntaxKind.NullLiteralExpression); 1008N(SyntaxKind.NullLiteralExpression); 1146N(SyntaxKind.NullLiteralExpression); 1271N(SyntaxKind.NullLiteralExpression);
Parsing\FunctionPointerTests.cs (1)
3016N(SyntaxKind.NullLiteralExpression);
Parsing\LambdaParameterParsingTests.cs (11)
2163N(SyntaxKind.NullLiteralExpression); 2257N(SyntaxKind.NullLiteralExpression); 2377N(SyntaxKind.NullLiteralExpression); 2447N(SyntaxKind.NullLiteralExpression); 2527N(SyntaxKind.NullLiteralExpression); 4290N(SyntaxKind.NullLiteralExpression); 4350N(SyntaxKind.NullLiteralExpression); 4424N(SyntaxKind.NullLiteralExpression); 4497N(SyntaxKind.NullLiteralExpression); 4579N(SyntaxKind.NullLiteralExpression); 4669N(SyntaxKind.NullLiteralExpression);
Parsing\LambdaReturnTypeParsingTests.cs (17)
443N(SyntaxKind.NullLiteralExpression); 686N(SyntaxKind.NullLiteralExpression); 761N(SyntaxKind.NullLiteralExpression); 849N(SyntaxKind.NullLiteralExpression); 1986N(SyntaxKind.NullLiteralExpression); 2025N(SyntaxKind.NullLiteralExpression); 2059N(SyntaxKind.NullLiteralExpression); 2094N(SyntaxKind.NullLiteralExpression); 2142N(SyntaxKind.NullLiteralExpression); 2332N(SyntaxKind.NullLiteralExpression); 3096N(SyntaxKind.NullLiteralExpression); 3139N(SyntaxKind.NullLiteralExpression); 3160N(SyntaxKind.NullLiteralExpression); 3208N(SyntaxKind.NullLiteralExpression); 3386N(SyntaxKind.NullLiteralExpression); 3442N(SyntaxKind.NullLiteralExpression); 4963N(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); 8499N(SyntaxKind.NullLiteralExpression); 8654N(SyntaxKind.NullLiteralExpression);
Parsing\StatementAttributeParsingTests.cs (4)
1374N(SyntaxKind.NullLiteralExpression); 1451N(SyntaxKind.NullLiteralExpression); 1538N(SyntaxKind.NullLiteralExpression); 2131N(SyntaxKind.NullLiteralExpression);
Parsing\StatementParsingTests.cs (1)
2742N(SyntaxKind.NullLiteralExpression);
Parsing\SuppressNullableWarningExpressionParsingTests.cs (3)
56N(SyntaxKind.NullLiteralExpression); 170N(SyntaxKind.NullLiteralExpression); 214N(SyntaxKind.NullLiteralExpression);
Syntax\SyntaxTests.cs (1)
234[InlineData(SyntaxKind.NullKeyword, SyntaxKind.NullLiteralExpression)]
Microsoft.CodeAnalysis.CSharp.Workspaces (7)
CastSimplifier.cs (2)
315var isNullLiteralCast = castedExpressionNode.WalkDownParentheses().IsKind(SyntaxKind.NullLiteralExpression); 869if (otherSide.WalkDownParentheses().Kind() == SyntaxKind.NullLiteralExpression)
CodeGeneration\CSharpSyntaxGenerator.cs (1)
3253return SyntaxFactory.LiteralExpression(SyntaxKind.NullLiteralExpression);
CSharpSyntaxKinds.cs (1)
75public int NullLiteralExpression => (int)SyntaxKind.NullLiteralExpression;
CSharpUseImplicitTypeHelper.cs (1)
281if (expression.IsKind(SyntaxKind.NullLiteralExpression))
ExpressionGenerator.cs (1)
51=> SyntaxFactory.LiteralExpression(SyntaxKind.NullLiteralExpression);
SpeculationAnalyzer.cs (1)
454if (previousReplacedExpression.WalkDownParentheses().Kind() is SyntaxKind.NullLiteralExpression or SyntaxKind.DefaultLiteralExpression)
Microsoft.CodeAnalysis.CSharp.Workspaces.UnitTests (3)
CodeGeneration\SyntaxGeneratorTests.cs (3)
1318SyntaxKind.NullLiteralExpression)) 1452SyntaxKind.NullLiteralExpression))) 1460SyntaxKind.NullLiteralExpression)))
Microsoft.VisualStudio.LanguageServices.CSharp (1)
CodeModel\MethodXml\MethodXmlBuilder.cs (1)
176case SyntaxKind.NullLiteralExpression: