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

Disallow using ScopedRef in source #63046

Merged
merged 1 commit into from
Aug 9, 2022
Merged

Conversation

jcouv
Copy link
Member

@jcouv jcouv commented Jul 29, 2022

Fixes #62124

Relates to test plan #59194

@jcouv jcouv marked this pull request as ready for review August 5, 2022 16:04
@jcouv jcouv requested a review from a team as a code owner August 5, 2022 16:04
@jcouv jcouv requested a review from cston August 5, 2022 16:04
@jcouv
Copy link
Member Author

jcouv commented Aug 5, 2022

@dotnet/roslyn-compiler for second review. Thanks

@@ -771,7 +771,8 @@ protected override void DecodeWellKnownAttributeImpl(ref DecodeWellKnownAttribut
ReservedAttributes.IsByRefLikeAttribute |
ReservedAttributes.TupleElementNamesAttribute |
ReservedAttributes.NullableAttribute |
ReservedAttributes.NativeIntegerAttribute))
Copy link
Member

Choose a reason for hiding this comment

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

What about on method/return?

Copy link
Member

@cston cston Aug 8, 2022

Choose a reason for hiding this comment

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

[ScopedRef] is not expected on methods or returns. I'll add a test for [return: ScopedRef] (in a subsequent PR) since it looks like that case is untested.

Copy link
Member

Choose a reason for hiding this comment

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

Added [return: ScopedRef] test to AttributeTests_ScopedRef.ExplicitAttribute_ReferencedInSource_02() in #62886.

Copy link
Member

@333fred 333fred left a comment

Choose a reason for hiding this comment

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

Done review pass (commit 1)

@cston cston merged commit c59aa66 into dotnet:main Aug 9, 2022
@ghost ghost added this to the Next milestone Aug 9, 2022
@dibarbet dibarbet modified the milestones: Next, 17.4 P2 Sep 1, 2022
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.

Report error if ScopedRefAttribute is used directly in source
4 participants