-
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
Propagate marked attributes from method type parameters to type parameters of synthesized types. #76492
Propagate marked attributes from method type parameters to type parameters of synthesized types. #76492
Conversation
…eters of synthesized types.. Related to dotnet#73920.
7cdb07f
to
75f0fd4
Compare
@dotnet/roslyn-compiler Please review |
1 similar comment
@dotnet/roslyn-compiler Please review |
@dotnet/roslyn-compiler For the second review |
@@ -602,32 +602,71 @@ private TypeParameterConstraintKind GetConstraintKinds() | |||
} | |||
} | |||
|
|||
internal sealed class SourceMethodTypeParameterSymbol : SourceTypeParameterSymbolBase | |||
internal abstract class SourceMethodTypeParameterSymbol : SourceTypeParameterSymbol |
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.
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 does this refactoring enable?
All implementations of method type parameters in source have a common base distinct from the base of type type parameters
@@ -34,6 +34,19 @@ public override bool IsImplicitlyDeclared | |||
|
|||
internal override void AddSynthesizedAttributes(PEModuleBuilder moduleBuilder, ref ArrayBuilder<CSharpAttributeData> attributes) | |||
{ | |||
if (ContainingSymbol.Kind == SymbolKind.NamedType && | |||
_underlyingTypeParameter.OriginalDefinition is SourceMethodTypeParameterSymbol && |
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.
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 SourceMethodTypeParameterSymbol
Consider capturing in a local and reusing below:
is SourceMethodTypeParameterSymbol underlyingDefinition
I'll make this adjustment in the next PR
e416d99
into
dotnet:features/GeneratedCodeAttributes
Related to #73920.