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

Propagate marked attributes from method type parameters to type parameters of synthesized types. #76492

Conversation

AlekseyTs
Copy link
Contributor

@AlekseyTs AlekseyTs commented Dec 18, 2024

Related to #73920.

@AlekseyTs AlekseyTs requested a review from a team as a code owner December 18, 2024 16:58
@dotnet-issue-labeler dotnet-issue-labeler bot added the untriaged Issues and PRs which have not yet been triaged by a lead label Dec 18, 2024
@AlekseyTs AlekseyTs force-pushed the GeneratedCodeAttributes_02 branch from 7cdb07f to 75f0fd4 Compare December 20, 2024 04:16
@AlekseyTs
Copy link
Contributor Author

@dotnet/roslyn-compiler Please review

1 similar comment
@AlekseyTs
Copy link
Contributor Author

@dotnet/roslyn-compiler Please review

@AlekseyTs
Copy link
Contributor Author

@dotnet/roslyn-compiler For the second review

@@ -602,32 +602,71 @@ private TypeParameterConstraintKind GetConstraintKinds()
}
}

internal sealed class SourceMethodTypeParameterSymbol : SourceTypeParameterSymbolBase
internal abstract class SourceMethodTypeParameterSymbol : SourceTypeParameterSymbol
Copy link
Member

Choose a reason for hiding this comment

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

abstract class SourceMethodTypeParameterSymbol

What does this refactoring enable?

Copy link
Contributor Author

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 &&
Copy link
Member

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

Copy link
Contributor Author

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

@AlekseyTs AlekseyTs merged commit e416d99 into dotnet:features/GeneratedCodeAttributes Dec 26, 2024
24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Compilers untriaged Issues and PRs which have not yet been triaged by a lead
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants