Skip to content
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

Merged
merged 13 commits into from
Jun 27, 2022

Conversation

cston
Copy link
Member

@cston cston commented Jun 22, 2022

Address PROTOTYPE comments.

Also fixes #62085.

Proposal: low-level-struct-improvements.md
Test plan: #59194

@cston cston marked this pull request as ready for review June 24, 2022 05:26
@cston cston requested a review from a team as a code owner June 24, 2022 05:26
@cston cston changed the title Address comments referencing work items in features/ref-fields Address PROTOTYPE comments in features/ref-fields Jun 24, 2022
@RikkiGibson RikkiGibson self-assigned this Jun 24, 2022
@@ -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.
Copy link
Contributor

@AlekseyTs AlekseyTs Jun 24, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

// PROTOTYPE: fixed ref field use should be disallowed.

I didn't see any special handling around that for PE. #Closed

@@ -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.
Copy link
Contributor

@AlekseyTs AlekseyTs Jun 24, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

// PROTOTYPE: fixed ref field use should be disallowed.

Are we tracking similar issue for volatile or already handling that? #Closed

@AlekseyTs
Copy link
Contributor

AlekseyTs commented Jun 24, 2022

        // PROTOTYPE: `fixed ref` field use should be disallowed.

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)

@AlekseyTs
Copy link
Contributor

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));
Copy link
Contributor

@RikkiGibson RikkiGibson Jun 24, 2022

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
Copy link
Contributor

@RikkiGibson RikkiGibson Jun 25, 2022

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

Copy link
Member Author

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) { }
Copy link
Contributor

@RikkiGibson RikkiGibson Jun 25, 2022

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

@AlekseyTs
Copy link
Contributor

AlekseyTs commented Jun 27, 2022

.field public int32& modreq([mscorlib]System.Runtime.CompilerServices.IsVolatile) F

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)

Copy link
Contributor

@AlekseyTs AlekseyTs left a 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

@cston cston merged commit f27dec7 into dotnet:features/ref-fields Jun 27, 2022
@cston cston deleted the ref-fields-cleanup branch June 27, 2022 15:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants