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