-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Extensions: propagate attributes on type parameters #80032
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
Conversation
368c5b3 to
376f445
Compare
| } | ||
|
|
||
| [Theory, CombinatorialData] | ||
| public void PropagateAttributes_13(bool useCompilationReference) |
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.
Is it worth adding indexer tests now, marked skipped until we implement? #Resolved
| int ordinal = 0; | ||
| foreach (var tp in oldTypeParameters) | ||
| { | ||
| var newTp = synthesized ? |
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.
Is the comment above for when synthesized is true still accurate? It doesn't seem to include extension type parameters. #Resolved
| } | ||
| } | ||
|
|
||
| public class AAttribute : System.Attribute { } |
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.
This looks unused #Resolved
| 01 00 00 00 | ||
| ) | ||
| .param type T | ||
| .custom instance void AAttribute::.ctor() = ( |
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.
What's the reason for preserving all attributes? Why wouldn't we preserve just the ones marked with CompilerLoweringPreserve? #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.
The reason for including the attribute here is portability from classic extension methods. We want to produce exactly the same metadata that we did in classic form
I think this extends to adjacent scenarios, such as a static extension method, even though we're not bound by precedent
8013b59 to
1cd0f0d
Compare
Addresses part of #78963 ("Metadata: copying attributes (synthesized attributes like nullability? we copy some attributes from enclosing method to closure type, [...])")
Relates to test plan #76130
Relates to #73920