diff options
Diffstat (limited to 'src/linker/Linker.Steps/SweepStep.cs')
-rw-r--r-- | src/linker/Linker.Steps/SweepStep.cs | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/src/linker/Linker.Steps/SweepStep.cs b/src/linker/Linker.Steps/SweepStep.cs index bfe7c227c..670242d9e 100644 --- a/src/linker/Linker.Steps/SweepStep.cs +++ b/src/linker/Linker.Steps/SweepStep.cs @@ -449,16 +449,21 @@ namespace Mono.Linker.Steps if (type.IsWindowsRuntimeProjection) return; - if (type is GenericInstanceType git && git.HasGenericArguments) { + switch (type) { + case GenericInstanceType git: UpdateTypeScope (git.ElementType, assembly); foreach (var ga in git.GenericArguments) UpdateTypeScope (ga, assembly); return; - } - - if (type is ArrayType at) { + case ArrayType at: UpdateTypeScope (at.ElementType, assembly); return; + case PointerType pt: + UpdateTypeScope (pt.ElementType, assembly); + return; + case FunctionPointerType fpt: + // Currently not possible with C#: https://github.com/dotnet/roslyn/issues/48765 + throw new InternalErrorException ($"Function pointer type in custom attribute argument '{fpt}' - currently not supported."); } TypeDefinition td = type.Resolve (); |