diff --git a/Cpp2IL.Core/Model/Contexts/ArrayTypeAnalysisContext.cs b/Cpp2IL.Core/Model/Contexts/ArrayTypeAnalysisContext.cs index 83eebd2f..e7b6e9a4 100644 --- a/Cpp2IL.Core/Model/Contexts/ArrayTypeAnalysisContext.cs +++ b/Cpp2IL.Core/Model/Contexts/ArrayTypeAnalysisContext.cs @@ -19,5 +19,7 @@ public ArrayTypeAnalysisContext(Il2CppType rawType, AssemblyAnalysisContext refe public override string DefaultName => $"{ElementType.Name}[{Rank}]"; + public sealed override bool IsValueType => false; + public int Rank { get; } } diff --git a/Cpp2IL.Core/Model/Contexts/ByRefTypeAnalysisContext.cs b/Cpp2IL.Core/Model/Contexts/ByRefTypeAnalysisContext.cs index 45b44328..928cf9fe 100644 --- a/Cpp2IL.Core/Model/Contexts/ByRefTypeAnalysisContext.cs +++ b/Cpp2IL.Core/Model/Contexts/ByRefTypeAnalysisContext.cs @@ -17,5 +17,7 @@ public ByRefTypeAnalysisContext(Il2CppType rawType, AssemblyAnalysisContext refe public override string DefaultName => $"{ElementType.Name}&"; + public sealed override bool IsValueType => false; + public override TypeAnalysisContext ElementType => base.ElementType ?? throw new("TODO Support TYPE_BYREF"); } diff --git a/Cpp2IL.Core/Model/Contexts/PointerTypeAnalysisContext.cs b/Cpp2IL.Core/Model/Contexts/PointerTypeAnalysisContext.cs index 7dc64df7..70309d88 100644 --- a/Cpp2IL.Core/Model/Contexts/PointerTypeAnalysisContext.cs +++ b/Cpp2IL.Core/Model/Contexts/PointerTypeAnalysisContext.cs @@ -17,4 +17,6 @@ public PointerTypeAnalysisContext(Il2CppType rawType, AssemblyAnalysisContext re public override Il2CppTypeEnum Type => Il2CppTypeEnum.IL2CPP_TYPE_PTR; public override string DefaultName => $"{ElementType.Name}*"; + + public sealed override bool IsValueType => false; } diff --git a/Cpp2IL.Core/Model/Contexts/SzArrayTypeAnalysisContext.cs b/Cpp2IL.Core/Model/Contexts/SzArrayTypeAnalysisContext.cs index e6e9a52e..e10ebb83 100644 --- a/Cpp2IL.Core/Model/Contexts/SzArrayTypeAnalysisContext.cs +++ b/Cpp2IL.Core/Model/Contexts/SzArrayTypeAnalysisContext.cs @@ -17,4 +17,6 @@ public SzArrayTypeAnalysisContext(Il2CppType rawType, AssemblyAnalysisContext re public override Il2CppTypeEnum Type => Il2CppTypeEnum.IL2CPP_TYPE_SZARRAY; public override string DefaultName => $"{ElementType.Name}[]"; + + public sealed override bool IsValueType => false; } diff --git a/Cpp2IL.Core/Model/Contexts/WrappedTypeAnalysisContext.cs b/Cpp2IL.Core/Model/Contexts/WrappedTypeAnalysisContext.cs index 4c19f563..ed27a87d 100644 --- a/Cpp2IL.Core/Model/Contexts/WrappedTypeAnalysisContext.cs +++ b/Cpp2IL.Core/Model/Contexts/WrappedTypeAnalysisContext.cs @@ -12,8 +12,6 @@ public abstract class WrappedTypeAnalysisContext : ReferencedTypeAnalysisContext public override string DefaultNs => ElementType.Namespace; - public override bool IsValueType => ElementType.IsValueType; //We don't set a definition so the default implementation cannot determine if we're a value type or not. - protected WrappedTypeAnalysisContext(TypeAnalysisContext elementType, AssemblyAnalysisContext referencedFrom) : base(referencedFrom) { ElementType = elementType;