-
Notifications
You must be signed in to change notification settings - Fork 4.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support parsing of checked user-defined operator declarations #59504
Support parsing of checked user-defined operator declarations #59504
Conversation
@@ -3305,8 +3305,23 @@ private ConversionOperatorDeclarationSyntax TryParseConversionOperatorDeclaratio | |||
|
|||
if (style.IsMissing) | |||
{ | |||
if (this.CurrentToken.Kind != SyntaxKind.OperatorKeyword || SyntaxFacts.IsAnyOverloadableOperator(this.PeekToken(1).Kind) || | |||
bool possibleConversion = true; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: remove initial value. it is never observed. #Resolved
NIt: consider detecting, reporting, and gracefully recovering from errant use of |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Grammar/Parser changes LGTM.
@@ -2514,6 +2514,33 @@ public static BlockSyntax Block(IEnumerable<StatementSyntax> statements) | |||
expressionBody: expressionBody); | |||
} | |||
|
|||
/// <summary>Creates a new ConversionOperatorDeclarationSyntax instance.</summary> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: <see cref="..." />
(applies to below methods as well) #Resolved
@dotnet/roslyn-compiler Please review |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@333fred, @dotnet/roslyn-compiler For the second review. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM Thanks (iteration 1). You could address Cyrus's comment about unnecessary local initialization in LanguageParser in follow-up PR
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM (commit 1)
azp /run |
/azp run |
Azure Pipelines successfully started running 4 pipeline(s). |
https://github.com/dotnet/csharplang/blob/main/proposals/checked-user-defined-operators.md
Language version checks and whether
checked
is applicable to specific operator will be checked during declaration binding and is out of scope for this PR.Relates to test plan #59458