-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Closed
Labels
Area-CompilersConcept-APIThis issue involves adding, removing, clarification, or modification of an API.This issue involves adding, removing, clarification, or modification of an API.Feature Requestapi-approvedAPI was approved in API review, it can be implementedAPI was approved in API review, it can be implementeduntriagedIssues and PRs which have not yet been triaged by a leadIssues and PRs which have not yet been triaged by a lead
Description
Background and Motivation
Syntax API changes to support the field keyword in properties.
// Example use of the field keyword
object Property
{
get { return field; }
set { field = value; }
}Proposed API
namespace Microsoft.CodeAnalysis.CSharp
{
public enumm SyntaxKind : ushort
{
// ...
FieldKeyword = 8412,
// ...
+ FieldExpression = 8757,
}
}
namespace Microsoft.CodeAnalysis.CSharp.Syntax
{
+ public sealed class FieldExpressionSyntax : ExpressionSyntax
+ {
+ /// <summary>SyntaxToken representing the field keyword.</summary>
+ public SyntaxToken Token { get; }
+
+ public FieldExpressionSyntax Update(SyntaxToken token);
+
+ public FieldExpressionSyntax WithToken(SyntaxToken token);
+ }
}Usage Examples
// some lines of code hereAlternative Designs
Risks
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Area-CompilersConcept-APIThis issue involves adding, removing, clarification, or modification of an API.This issue involves adding, removing, clarification, or modification of an API.Feature Requestapi-approvedAPI was approved in API review, it can be implementedAPI was approved in API review, it can be implementeduntriagedIssues and PRs which have not yet been triaged by a leadIssues and PRs which have not yet been triaged by a lead