-
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
Address PROTOTYPE comments in features/ref-fields #62088
Conversation
85ef462
to
c8a7b60
Compare
c8a7b60
to
0574002
Compare
…m.Runtime.CompilerServices.RuntimeFeature.ByRefFields
@@ -326,7 +326,6 @@ private void EnsureSignatureIsLoaded() | |||
_packedFlags.SetRefKind(refKind); | |||
_packedFlags.SetIsVolatile(customModifiersArray.Any(static m => !m.IsOptional && ((CSharpCustomModifier)m).ModifierSymbol.SpecialType == SpecialType.System_Runtime_CompilerServices_IsVolatile)); | |||
|
|||
// PROTOTYPE: `fixed ref` field use should be disallowed. |
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.
@@ -326,7 +326,6 @@ private void EnsureSignatureIsLoaded() | |||
_packedFlags.SetRefKind(refKind); | |||
_packedFlags.SetIsVolatile(customModifiersArray.Any(static m => !m.IsOptional && ((CSharpCustomModifier)m).ModifierSymbol.SpecialType == SpecialType.System_Runtime_CompilerServices_IsVolatile)); | |||
|
|||
// PROTOTYPE: `fixed ref` field use should be disallowed. |
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.
The comment doesn't appear to be addressed. There probably should be an error about the field being unsupported. In reply to: 1165887859 In reply to: 1165887859 Refers to: src/Compilers/CSharp/Test/Semantic/Semantics/RefFieldTests.cs:454 in 9ace414. [](commit_id = 9ace414, deletion_comment = True) |
Done with review pass (commit 10) |
@@ -55,7 +55,7 @@ protected override ImmutableArray<LocalSymbol> BuildLocals() | |||
|
|||
foreach (VariableDeclaratorSyntax declarator in declarationSyntax.Variables) | |||
{ | |||
locals.Add(MakeLocal(declarationSyntax, declarator, LocalDeclarationKind.UsingVariable, hasScopedModifier: false)); // PROTOTYPE: Handle 'scoped' modifier. | |||
locals.Add(MakeLocal(declarationSyntax, declarator, LocalDeclarationKind.UsingVariable, hasScopedModifier: false)); |
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.
if a tracking issue exists for these, consider replacing the prototype comment with a link to the issue rather than deleting. #Resolved
// PROTOTYPE: Should report duplicate modifiers. | ||
comp.VerifyEmitDiagnostics(); | ||
comp.VerifyEmitDiagnostics( | ||
// (4,27): error CS1107: A parameter can only have one 'scoped' modifier |
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.
I found this slightly surprising. I thought we were going to make 'scoped' as a type name an error like we did for 'required' as a type name. #Resolved
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.
We're not reporting an error for scoped
as a type name yet.
static void F1(this scoped R<object> r) { } | ||
static void F2<T>(scoped this R<T> r) { } | ||
static void F3<T>(this scoped ref T t) where T : struct { } | ||
static void F4(this ref scoped R<int> r) { } |
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.
consider also checking a this
parameter with no scoped modifiers as a baseline. #Resolved
Are we testing scenario with the modifier before the In reply to: 1167252641 In reply to: 1167252641 Refers to: src/Compilers/CSharp/Test/Semantic/Semantics/RefFieldTests.cs:473 in 972408c. [](commit_id = 972408c, deletion_comment = False) |
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 13), assuming CI is passing
Address PROTOTYPE comments.
Also fixes #62085.
Proposal: low-level-struct-improvements.md
Test plan: #59194