diff options
Diffstat (limited to 'src/Common/src/TypeSystem/Common/ArrayType.cs')
-rw-r--r-- | src/Common/src/TypeSystem/Common/ArrayType.cs | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/Common/src/TypeSystem/Common/ArrayType.cs b/src/Common/src/TypeSystem/Common/ArrayType.cs index 3dbd00b85..384e487d2 100644 --- a/src/Common/src/TypeSystem/Common/ArrayType.cs +++ b/src/Common/src/TypeSystem/Common/ArrayType.cs @@ -118,8 +118,12 @@ namespace Internal.TypeSystem public override TypeDesc InstantiateSignature(Instantiation typeInstantiation, Instantiation methodInstantiation) { - TypeDesc instantiatedElementType = this.ElementType.InstantiateSignature(typeInstantiation, methodInstantiation); - return instantiatedElementType.Context.GetArrayType(instantiatedElementType, _rank); + TypeDesc elementType = this.ElementType; + TypeDesc instantiatedElementType = elementType.InstantiateSignature(typeInstantiation, methodInstantiation); + if (instantiatedElementType != elementType) + return Context.GetArrayType(instantiatedElementType, _rank); + + return this; } protected override TypeFlags ComputeTypeFlags(TypeFlags mask) |