Base:
property
ExpressionBody
Microsoft.CodeAnalysis.CSharp.Syntax.BaseMethodDeclarationSyntax.ExpressionBody
48 references to ExpressionBody
Microsoft.CodeAnalysis.CSharp (21)
Binder\Binder.CapturedParametersFinder.cs (1)
122
finder.CheckIdentifiersInNode(s.
ExpressionBody
, bodyBinder);
Binder\Binder_Statements.cs (3)
3754
if (initializer == null && constructor.Body == null && constructor.
ExpressionBody
== null)
3789
constructor.
ExpressionBody
== null ?
3791
bodyBinder.BindExpressionBodyAsBlock(constructor.
ExpressionBody
,
Binder\LocalBinderFactory.cs (1)
160
Visit(node.
ExpressionBody
, enclosing);
Compiler\MethodCompiler.cs (1)
2138
addIdentifiers(s.
ExpressionBody
, identifierMap);
src\Compilers\CSharp\CSharpAnalyzerDriver\CSharpDeclarationComputer.cs (1)
457
arrowExpr = ((ConstructorDeclarationSyntax)node).
ExpressionBody
;
Symbols\Source\SourceConstructorSymbol.cs (3)
95
syntax.Body, syntax.
ExpressionBody
, syntax, diagnostics);
263
else if (ctorSyntax.
ExpressionBody
?.Span.Contains(position) == true)
265
offset = position - ctorSyntax.
ExpressionBody
.Span.Start;
Symbols\Source\SourceMethodSymbolWithAttributes.cs (1)
47
return constructor.Initializer ?? (CSharpSyntaxNode?)constructor.Body ?? constructor.
ExpressionBody
;
Syntax.xml.Main.Generated.cs (1)
2068
=> node.Update(VisitList(node.AttributeLists), VisitList(node.Modifiers), VisitToken(node.Identifier), (ParameterListSyntax?)Visit(node.ParameterList) ?? throw new ArgumentNullException("parameterList"), (ConstructorInitializerSyntax?)Visit(node.Initializer), (BlockSyntax?)Visit(node.Body), (ArrowExpressionClauseSyntax?)Visit(node.
ExpressionBody
), VisitToken(node.SemicolonToken));
Syntax.xml.Syntax.Generated.cs (8)
12791
if (attributeLists != this.AttributeLists || modifiers != this.Modifiers || identifier != this.Identifier || parameterList != this.ParameterList || initializer != this.Initializer || body != this.Body || expressionBody != this.
ExpressionBody
|| semicolonToken != this.SemicolonToken)
12802
public new ConstructorDeclarationSyntax WithAttributeLists(SyntaxList<AttributeListSyntax> attributeLists) => Update(attributeLists, this.Modifiers, this.Identifier, this.ParameterList, this.Initializer, this.Body, this.
ExpressionBody
, this.SemicolonToken);
12804
public new ConstructorDeclarationSyntax WithModifiers(SyntaxTokenList modifiers) => Update(this.AttributeLists, modifiers, this.Identifier, this.ParameterList, this.Initializer, this.Body, this.
ExpressionBody
, this.SemicolonToken);
12805
public ConstructorDeclarationSyntax WithIdentifier(SyntaxToken identifier) => Update(this.AttributeLists, this.Modifiers, identifier, this.ParameterList, this.Initializer, this.Body, this.
ExpressionBody
, this.SemicolonToken);
12807
public new ConstructorDeclarationSyntax WithParameterList(ParameterListSyntax parameterList) => Update(this.AttributeLists, this.Modifiers, this.Identifier, parameterList, this.Initializer, this.Body, this.
ExpressionBody
, this.SemicolonToken);
12808
public ConstructorDeclarationSyntax WithInitializer(ConstructorInitializerSyntax? initializer) => Update(this.AttributeLists, this.Modifiers, this.Identifier, this.ParameterList, initializer, this.Body, this.
ExpressionBody
, this.SemicolonToken);
12810
public new ConstructorDeclarationSyntax WithBody(BlockSyntax? body) => Update(this.AttributeLists, this.Modifiers, this.Identifier, this.ParameterList, this.Initializer, body, this.
ExpressionBody
, this.SemicolonToken);
12814
public new ConstructorDeclarationSyntax WithSemicolonToken(SyntaxToken semicolonToken) => Update(this.AttributeLists, this.Modifiers, this.Identifier, this.ParameterList, this.Initializer, this.Body, this.
ExpressionBody
, semicolonToken);
Syntax\LookupPosition.cs (1)
182
var hasBody = constructorDecl.Body != null || constructorDecl.
ExpressionBody
!= null;
Microsoft.CodeAnalysis.CSharp.CodeStyle (4)
src\Analyzers\CSharp\Analyzers\UseExpressionBody\Helpers\UseExpressionBodyForConstructorsHelper.cs (1)
35
=> declaration.
ExpressionBody
;
src\Analyzers\CSharp\Analyzers\UsePrimaryConstructor\CSharpUsePrimaryConstructorDiagnosticAnalyzer.cs (3)
312
if (primaryConstructorDeclaration is { Body: null,
ExpressionBody
: null })
391
var body = primaryConstructorDeclaration.
ExpressionBody
?? (SyntaxNode?)primaryConstructorDeclaration.Body;
397
{
ExpressionBody
.Expression: AssignmentExpressionSyntax assignmentExpression }
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (3)
src\Analyzers\CSharp\CodeFixes\UsePrimaryConstructor\CSharpUsePrimaryConstructorCodeFixProvider.cs (2)
445
if (constructorDeclaration.
ExpressionBody
is not null)
449
(AssignmentExpressionSyntax)constructorDeclaration.
ExpressionBody
.Expression, expressionStatement: null).ConfigureAwait(false);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\ConstructorGenerator.cs (1)
74
if (declaration.
ExpressionBody
== null)
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (1)
Semantics\OutVarTests.cs (1)
18824
Assert.False(mm.TestOnlyTryGetBoundNodesFromMap(constructorDeclaration.
ExpressionBody
).IsEmpty);
Microsoft.CodeAnalysis.CSharp.Features (15)
EditAndContinue\BreakpointSpans.cs (5)
442
if (constructorSyntax.
ExpressionBody
!= null &&
443
position > constructorSyntax.
ExpressionBody
.ArrowToken.Span.Start)
445
return constructorSyntax.
ExpressionBody
.Expression.Span;
456
if (constructorSyntax.
ExpressionBody
!= null)
458
return constructorSyntax.
ExpressionBody
.Expression.Span;
EditAndContinue\DeclarationBody\OrdinaryInstanceConstructorDeclarationBody.cs (1)
18
=> (SyntaxNode?)constructor.Body ?? constructor.
ExpressionBody
?.Expression!;
EditAndContinue\SyntaxUtilities.cs (2)
45
ConstructorDeclarationSyntax constructorDeclaration when constructorDeclaration.Body != null || constructorDeclaration.
ExpressionBody
!= null
47
? CreateSimpleBody(BlockOrExpression(constructorDeclaration.Body, constructorDeclaration.
ExpressionBody
))
src\Analyzers\CSharp\Analyzers\UseExpressionBody\Helpers\UseExpressionBodyForConstructorsHelper.cs (1)
35
=> declaration.
ExpressionBody
;
src\Analyzers\CSharp\Analyzers\UsePrimaryConstructor\CSharpUsePrimaryConstructorDiagnosticAnalyzer.cs (3)
312
if (primaryConstructorDeclaration is { Body: null,
ExpressionBody
: null })
391
var body = primaryConstructorDeclaration.
ExpressionBody
?? (SyntaxNode?)primaryConstructorDeclaration.Body;
397
{
ExpressionBody
.Expression: AssignmentExpressionSyntax assignmentExpression }
src\Analyzers\CSharp\CodeFixes\UsePrimaryConstructor\CSharpUsePrimaryConstructorCodeFixProvider.cs (2)
445
if (constructorDeclaration.
ExpressionBody
is not null)
449
(AssignmentExpressionSyntax)constructorDeclaration.
ExpressionBody
.Expression, expressionStatement: null).ConfigureAwait(false);
src\Compilers\CSharp\CSharpAnalyzerDriver\CSharpDeclarationComputer.cs (1)
457
arrowExpr = ((ConstructorDeclarationSyntax)node).
ExpressionBody
;
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (2)
Generated\Syntax.Test.xml.Generated.cs (2)
13491
Assert.Null(node.
ExpressionBody
);
13493
var newNode = node.WithAttributeLists(node.AttributeLists).WithModifiers(node.Modifiers).WithIdentifier(node.Identifier).WithParameterList(node.ParameterList).WithInitializer(node.Initializer).WithBody(node.Body).WithExpressionBody(node.
ExpressionBody
).WithSemicolonToken(node.SemicolonToken);
Microsoft.CodeAnalysis.CSharp.Workspaces (1)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\ConstructorGenerator.cs (1)
74
if (declaration.
ExpressionBody
== null)
Roslyn.Diagnostics.CSharp.Analyzers (1)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\ConstructorGenerator.cs (1)
74
if (declaration.
ExpressionBody
== null)