Skip to content

Commit

Permalink
Fixup
Browse files Browse the repository at this point in the history
  • Loading branch information
AlekseyTs committed Dec 20, 2024
1 parent b8a9c4b commit 159ef0b
Showing 1 changed file with 5 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,18 +34,14 @@ public override bool IsImplicitlyDeclared

internal override void AddSynthesizedAttributes(PEModuleBuilder moduleBuilder, ref ArrayBuilder<CSharpAttributeData> attributes)
{
if (ContainingSymbol.Kind == SymbolKind.NamedType)
if (ContainingSymbol.Kind == SymbolKind.NamedType &&
ContainingSymbol.ContainingModule == _underlyingTypeParameter.OriginalDefinition.ContainingModule)
{
Debug.Assert(ContainingSymbol.ContainingModule == _underlyingTypeParameter.OriginalDefinition.ContainingModule);

if (ContainingSymbol.ContainingModule == _underlyingTypeParameter.OriginalDefinition.ContainingModule)
foreach (CSharpAttributeData attr in _underlyingTypeParameter.OriginalDefinition.GetAttributes())
{
foreach (CSharpAttributeData attr in _underlyingTypeParameter.OriginalDefinition.GetAttributes())
if (attr.AttributeClass is { HasCompilerLoweringPreserveAttribute: true })
{
if (attr.AttributeClass is { HasCompilerLoweringPreserveAttribute: true })
{
AddSynthesizedAttribute(ref attributes, attr);
}
AddSynthesizedAttribute(ref attributes, attr);
}
}
}
Expand Down

0 comments on commit 159ef0b

Please sign in to comment.