diff --git a/ICSharpCode.Decompiler/TypeSystem/TypeProvider.cs b/ICSharpCode.Decompiler/TypeSystem/TypeProvider.cs index df2cb6402..39c2bcad3 100644 --- a/ICSharpCode.Decompiler/TypeSystem/TypeProvider.cs +++ b/ICSharpCode.Decompiler/TypeSystem/TypeProvider.cs @@ -72,6 +72,13 @@ namespace ICSharpCode.Decompiler.TypeSystem public IType GetGenericInstantiation(IType genericType, ImmutableArray typeArguments) { + int tpc = genericType.TypeParameterCount; + if (tpc == 0 || tpc != typeArguments.Length) + { + // This can occur when the genericType is from another assembly, + // doesn't have the typical `1 suffix, and that other assembly is not loaded. + return genericType; + } return new ParameterizedType(genericType, typeArguments); }