-
Notifications
You must be signed in to change notification settings - Fork 4k
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
Disallow types named 'scoped' #62968
Conversation
All lowercase types are already disallowed, no? |
We only produce a warning wave warning for those. So we escalate to an error when we actually start using a lowercase word as contextual keyword. |
@@ -478,7 +478,8 @@ internal static void ReportReservedTypeName(string? name, CSharpCompilation comp | |||
|
|||
if (reportIfContextual(SyntaxKind.RecordKeyword, MessageID.IDS_FeatureRecords, ErrorCode.WRN_RecordNamedDisallowed) |
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.
Curious why records is warning and other contextual keywords are errors?
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.
Would have to dig up the PR and/or LDM notes. Most likely this was evolution of our philosophy towards such breaks. Records came before we added the warning wave warning.
Fixes #62931
The breaking change was documented in https://github.com/dotnet/roslyn/pull/62788/files#diff-b58628cb08a707ff68b2546a1ad0ddf3a900aebb0ba899063c3ffe0a8ae7f07d
Relates to test plan #59194