Skip to content

Commit

Permalink
Update MetadataCodegen.cs
Browse files Browse the repository at this point in the history
  • Loading branch information
LPeter1997 committed Nov 13, 2024
1 parent 02ed123 commit 3429e63
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/Draco.Compiler/Internal/Codegen/MetadataCodegen.cs
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,16 @@ Symbol GetContainingSymbol()
}

if (func.ContainingSymbol is not TypeSymbol type) return func.ContainingSymbol!;

if (type is SourceClassSymbol { IsGenericDefinition: true } sourceClass)
{
// TODO: Same hack as for FieldSymbol
var generics = sourceClass.GenericParameters
.Cast<TypeSymbol>()
.ToImmutableArray();
return sourceClass.GenericInstantiate(sourceClass.ContainingSymbol, generics);
}

if (!type.IsArrayType) return type;
// NOTE: This hack is present because of Arrays spit out stuff from their base types
// to take priority
Expand Down

0 comments on commit 3429e63

Please sign in to comment.