92 references to DefaultLiteralExpression
Microsoft.CodeAnalysis.CSharp (5)
Binder\Binder_Expressions.cs (1)
720
case SyntaxKind.
DefaultLiteralExpression
:
Binder\Binder_Patterns.cs (1)
475
case SyntaxKind.
DefaultLiteralExpression
:
Parser\LanguageParser.cs (2)
10975
case SyntaxKind.
DefaultLiteralExpression
:
12278
return _syntaxFactory.LiteralExpression(SyntaxKind.
DefaultLiteralExpression
, keyword);
Syntax\LiteralExpressionSyntax.cs (1)
27
SyntaxKind.
DefaultLiteralExpression
=> SyntaxKind.DefaultKeyword,
Microsoft.CodeAnalysis.CSharp.CodeStyle (9)
src\Analyzers\CSharp\Analyzers\UseLocalFunction\CSharpUseLocalFunctionDiagnosticAnalyzer.cs (1)
370
SyntaxKind.
DefaultLiteralExpression
or
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\DefaultExpressionSyntaxExtensions.cs (1)
16
SyntaxFactory.LiteralExpression(SyntaxKind.
DefaultLiteralExpression
);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SyntaxFacts\CSharpSyntaxKinds.cs (1)
85
public int DefaultLiteralExpression => (int)SyntaxKind.
DefaultLiteralExpression
;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Simplification\Simplifiers\CastSimplifier.cs (4)
186
var isDefaultLiteralCast = castedExpressionNode.WalkDownParentheses().IsKind(SyntaxKind.
DefaultLiteralExpression
);
859
if (originalConditionalExpression.WhenTrue.WalkDownParentheses().IsKind(SyntaxKind.
DefaultLiteralExpression
) ||
860
originalConditionalExpression.WhenFalse.WalkDownParentheses().IsKind(SyntaxKind.
DefaultLiteralExpression
))
911
if (castExpression.Expression.WalkDownParentheses().IsKind(SyntaxKind.
DefaultLiteralExpression
))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\SpeculationAnalyzer.cs (2)
302
if (expression.WalkDownParentheses().IsKind(SyntaxKind.
DefaultLiteralExpression
))
466
if (previousReplacedExpression.WalkDownParentheses().Kind() is SyntaxKind.NullLiteralExpression or SyntaxKind.
DefaultLiteralExpression
)
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (6)
src\Analyzers\CSharp\CodeFixes\ConvertToRecord\ConvertToRecordHelpers.cs (1)
415
: SyntaxKind.
DefaultLiteralExpression
);
src\Analyzers\CSharp\CodeFixes\Nullable\CSharpDeclareAsNullableCodeFixProvider.cs (1)
319
SyntaxKind.
DefaultLiteralExpression
or
src\Analyzers\CSharp\CodeFixes\ReplaceDefaultLiteral\CSharpReplaceDefaultLiteralCodeFixProvider.cs (1)
45
token.Parent is LiteralExpressionSyntax(SyntaxKind.
DefaultLiteralExpression
) defaultLiteral)
src\Analyzers\CSharp\CodeFixes\UseDefaultLiteral\CSharpUseDefaultLiteralCodeFixProvider.cs (1)
60
SyntaxFactory.LiteralExpression(SyntaxKind.
DefaultLiteralExpression
).WithTriviaFrom(defaultExpression)),
src\Analyzers\CSharp\CodeFixes\UseExplicitArrayInExpressionTree\CSharpUseExplicitArrayInExpressionTreeCodeFixProvider.cs (1)
134
a => a.Expression.Kind() != SyntaxKind.
DefaultLiteralExpression
&& Equals(arrayElementType, semanticModel.GetTypeInfo(a.Expression).Type));
src\Analyzers\CSharp\CodeFixes\UsePatternCombinators\CSharpUsePatternCombinatorsCodeFixProvider.cs (1)
131
if (expr.IsKind(SyntaxKind.
DefaultLiteralExpression
))
Microsoft.CodeAnalysis.CSharp.Emit.UnitTests (6)
CodeGen\CodeGenFunctionPointersTests.cs (1)
4921
.Where(l => l.IsKind(SyntaxKind.
DefaultLiteralExpression
))
CodeGen\CodeGenTupleEqualityTests.cs (5)
1056
.Where(e => e.Kind() == SyntaxKind.
DefaultLiteralExpression
);
1090
.Where(e => e.Kind() == SyntaxKind.
DefaultLiteralExpression
);
1122
.Where(e => e.Kind() == SyntaxKind.
DefaultLiteralExpression
);
1153
.Where(e => e.Kind() == SyntaxKind.
DefaultLiteralExpression
);
1212
.Where(e => e.Kind() == SyntaxKind.
DefaultLiteralExpression
);
Microsoft.CodeAnalysis.CSharp.Features (8)
ExtractMethod\CSharpMethodExtractor.CSharpCodeGenerator.cs (1)
515
: LiteralExpression(SyntaxKind.
DefaultLiteralExpression
);
src\Analyzers\CSharp\Analyzers\UseLocalFunction\CSharpUseLocalFunctionDiagnosticAnalyzer.cs (1)
370
SyntaxKind.
DefaultLiteralExpression
or
src\Analyzers\CSharp\CodeFixes\ConvertToRecord\ConvertToRecordHelpers.cs (1)
415
: SyntaxKind.
DefaultLiteralExpression
);
src\Analyzers\CSharp\CodeFixes\Nullable\CSharpDeclareAsNullableCodeFixProvider.cs (1)
319
SyntaxKind.
DefaultLiteralExpression
or
src\Analyzers\CSharp\CodeFixes\ReplaceDefaultLiteral\CSharpReplaceDefaultLiteralCodeFixProvider.cs (1)
45
token.Parent is LiteralExpressionSyntax(SyntaxKind.
DefaultLiteralExpression
) defaultLiteral)
src\Analyzers\CSharp\CodeFixes\UseDefaultLiteral\CSharpUseDefaultLiteralCodeFixProvider.cs (1)
60
SyntaxFactory.LiteralExpression(SyntaxKind.
DefaultLiteralExpression
).WithTriviaFrom(defaultExpression)),
src\Analyzers\CSharp\CodeFixes\UseExplicitArrayInExpressionTree\CSharpUseExplicitArrayInExpressionTreeCodeFixProvider.cs (1)
134
a => a.Expression.Kind() != SyntaxKind.
DefaultLiteralExpression
&& Equals(arrayElementType, semanticModel.GetTypeInfo(a.Expression).Type));
src\Analyzers\CSharp\CodeFixes\UsePatternCombinators\CSharpUsePatternCombinatorsCodeFixProvider.cs (1)
131
if (expr.IsKind(SyntaxKind.
DefaultLiteralExpression
))
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (1)
Semantics\NullCoalesceAssignmentTests.cs (1)
184
var defaultLiteral = syntaxRoot.DescendantNodes().OfType<LiteralExpressionSyntax>().Where(expr => expr.IsKind(SyntaxKind.
DefaultLiteralExpression
)).Single();
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (43)
Parsing\DeclarationScopeParsingTests.cs (7)
262
N(SyntaxKind.
DefaultLiteralExpression
);
335
N(SyntaxKind.
DefaultLiteralExpression
);
364
N(SyntaxKind.
DefaultLiteralExpression
);
456
N(SyntaxKind.
DefaultLiteralExpression
);
2538
N(SyntaxKind.
DefaultLiteralExpression
);
9230
N(SyntaxKind.
DefaultLiteralExpression
);
13159
N(SyntaxKind.
DefaultLiteralExpression
);
Parsing\ExpressionParsingTests.cs (1)
4764
Assert.Equal(SyntaxKind.
DefaultLiteralExpression
, expr.Kind());
Parsing\ForStatementParsingTest.cs (3)
2944
N(SyntaxKind.
DefaultLiteralExpression
);
2949
N(SyntaxKind.
DefaultLiteralExpression
);
2954
N(SyntaxKind.
DefaultLiteralExpression
);
Parsing\LambdaReturnTypeParsingTests.cs (22)
66
N(SyntaxKind.
DefaultLiteralExpression
);
195
N(SyntaxKind.
DefaultLiteralExpression
);
478
N(SyntaxKind.
DefaultLiteralExpression
);
508
N(SyntaxKind.
DefaultLiteralExpression
);
538
N(SyntaxKind.
DefaultLiteralExpression
);
582
N(SyntaxKind.
DefaultLiteralExpression
);
656
N(SyntaxKind.
DefaultLiteralExpression
);
1431
N(SyntaxKind.
DefaultLiteralExpression
);
1472
N(SyntaxKind.
DefaultLiteralExpression
);
2331
N(SyntaxKind.
DefaultLiteralExpression
);
4944
N(SyntaxKind.
DefaultLiteralExpression
);
5047
N(SyntaxKind.
DefaultLiteralExpression
);
5087
N(SyntaxKind.
DefaultLiteralExpression
);
5123
N(SyntaxKind.
DefaultLiteralExpression
);
5197
N(SyntaxKind.
DefaultLiteralExpression
);
5300
N(SyntaxKind.
DefaultLiteralExpression
);
5438
N(SyntaxKind.
DefaultLiteralExpression
);
5533
N(SyntaxKind.
DefaultLiteralExpression
);
5588
N(SyntaxKind.
DefaultLiteralExpression
);
5689
N(SyntaxKind.
DefaultLiteralExpression
);
5755
N(SyntaxKind.
DefaultLiteralExpression
);
5812
N(SyntaxKind.
DefaultLiteralExpression
);
Parsing\MemberDeclarationParsingTests.cs (2)
11513
N(SyntaxKind.
DefaultLiteralExpression
);
11837
N(SyntaxKind.
DefaultLiteralExpression
);
Parsing\NameParsingTests.cs (1)
1486
N(SyntaxKind.
DefaultLiteralExpression
);
Parsing\NullableParsingTests.cs (1)
2312
N(SyntaxKind.
DefaultLiteralExpression
);
Parsing\StatementAttributeParsingTests.cs (2)
2599
N(SyntaxKind.
DefaultLiteralExpression
);
4733
N(SyntaxKind.
DefaultLiteralExpression
);
Parsing\SwitchExpressionParsingTests.cs (4)
2343
N(SyntaxKind.
DefaultLiteralExpression
);
2407
N(SyntaxKind.
DefaultLiteralExpression
);
2617
N(SyntaxKind.
DefaultLiteralExpression
);
2710
N(SyntaxKind.
DefaultLiteralExpression
);
Microsoft.CodeAnalysis.CSharp.Workspaces (9)
Simplification\Reducers\CSharpDefaultExpressionReducer.Rewriter.cs (1)
37
return SyntaxFactory.LiteralExpression(SyntaxKind.
DefaultLiteralExpression
)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\DefaultExpressionSyntaxExtensions.cs (1)
16
SyntaxFactory.LiteralExpression(SyntaxKind.
DefaultLiteralExpression
);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SyntaxFacts\CSharpSyntaxKinds.cs (1)
85
public int DefaultLiteralExpression => (int)SyntaxKind.
DefaultLiteralExpression
;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Simplification\Simplifiers\CastSimplifier.cs (4)
186
var isDefaultLiteralCast = castedExpressionNode.WalkDownParentheses().IsKind(SyntaxKind.
DefaultLiteralExpression
);
859
if (originalConditionalExpression.WhenTrue.WalkDownParentheses().IsKind(SyntaxKind.
DefaultLiteralExpression
) ||
860
originalConditionalExpression.WhenFalse.WalkDownParentheses().IsKind(SyntaxKind.
DefaultLiteralExpression
))
911
if (castExpression.Expression.WalkDownParentheses().IsKind(SyntaxKind.
DefaultLiteralExpression
))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\SpeculationAnalyzer.cs (2)
302
if (expression.WalkDownParentheses().IsKind(SyntaxKind.
DefaultLiteralExpression
))
466
if (previousReplacedExpression.WalkDownParentheses().Kind() is SyntaxKind.NullLiteralExpression or SyntaxKind.
DefaultLiteralExpression
)
Microsoft.Interop.SourceGeneration (5)
Marshalling\DelegateMarshaller.cs (2)
54
LiteralExpression(SyntaxKind.
DefaultLiteralExpression
)));
67
LiteralExpression(SyntaxKind.
DefaultLiteralExpression
)),
Marshalling\MarshallerHelpers.cs (2)
251
LiteralExpression(SyntaxKind.
DefaultLiteralExpression
, Token(SyntaxKind.DefaultKeyword)));
260
LiteralExpression(SyntaxKind.
DefaultLiteralExpression
, Token(SyntaxKind.DefaultKeyword)));
Utils\SyntaxFactoryExtensions.cs (1)
20
return Declare(typeSyntax, identifier, initializeToDefault ? LiteralExpression(SyntaxKind.
DefaultLiteralExpression
) : null);