-
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 UnscopedRefAttribute #62783
Support UnscopedRefAttribute #62783
Changes from 1 commit
7884b57
8dfbaae
51328cc
90dff6a
9a33cb6
7693628
a74d8f2
7a7a084
2d2deac
5c1101a
06a3c3b
df68917
28081a1
ccc843c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -294,7 +294,11 @@ private PEParameterSymbol( | |
typeWithAnnotations = NullableTypeDecoder.TransformType(typeWithAnnotations, handle, moduleSymbol, accessSymbol: accessSymbol, nullableContext: nullableContext); | ||
typeWithAnnotations = TupleTypeDecoder.DecodeTupleTypesIfApplicable(typeWithAnnotations, handle, moduleSymbol); | ||
|
||
if (_moduleSymbol.Module.HasLifetimeAnnotationAttribute(_handle, out var pair)) | ||
if (_moduleSymbol.Module.HasUnscopedRefAttribute(_handle)) | ||
{ | ||
scope = DeclarationScope.Unscoped; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should we mark the parameter as bad if there's both attributes? #Closed There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
} | ||
else if (_moduleSymbol.Module.HasLifetimeAnnotationAttribute(_handle, out var pair)) | ||
{ | ||
var scopeOpt = GetScope(refKind, typeWithAnnotations.Type, pair.IsRefScoped, pair.IsValueScoped); | ||
if (scopeOpt is null) | ||
|
@@ -978,7 +982,9 @@ public override ImmutableArray<SyntaxReference> DeclaringSyntaxReferences | |
} | ||
} | ||
|
||
internal sealed override DeclarationScope Scope => _packedFlags.Scope; | ||
internal sealed override DeclarationScope DeclaredScope => _packedFlags.Scope; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: Is There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It looks like There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
|
||
internal sealed override DeclarationScope EffectiveScope => DeclaredScope; | ||
|
||
private static DeclarationScope? GetScope(RefKind refKind, TypeSymbol type, bool isRefScoped, bool isValueScoped) | ||
{ | ||
|
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: other csharp blocks are left-indented. Not sure whether it's material (does that affect markup rendering on GitHub or docs.microsoft.com), but I'd stick with that to be safe. #Closed
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.
Without indenting, subsequent bullets start at 1.