Skip to content

Commit 138e379

Browse files
committed
Core: DummyDll: Fix valuetype not being set on type references
1 parent c56e809 commit 138e379

File tree

3 files changed

+5
-1
lines changed

3 files changed

+5
-1
lines changed

Cpp2IL.Core/Model/Contexts/GenericInstanceTypeAnalysisContext.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ public class GenericInstanceTypeAnalysisContext : ReferencedTypeAnalysisContext
2222

2323
public sealed override int GenericParameterCount => GenericArguments.Count;
2424

25+
public sealed override bool IsValueType => GenericType.IsValueType; //We don't set a definition so the default implementation cannot determine if we're a value type or not.
26+
2527
public GenericInstanceTypeAnalysisContext(Il2CppType rawType, AssemblyAnalysisContext referencedFrom) : base(referencedFrom)
2628
{
2729
//Generic type has to be a type definition

Cpp2IL.Core/Model/Contexts/TypeAnalysisContext.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ public static ITypeInfoProvider GetSndnProviderForType(ApplicationAnalysisContex
232232
public string RewrittenTypeName => Name;
233233
public string TypeNamespace => Namespace;
234234
public virtual bool IsGenericInstance => false;
235-
public bool IsValueType => Definition?.IsValueType ?? BaseType is { Namespace: "System", Name: "ValueType" };
235+
public virtual bool IsValueType => Definition?.IsValueType ?? BaseType is { Namespace: "System", Name: "ValueType" };
236236
public bool IsEnumType => Definition?.IsEnumType ?? BaseType is { Namespace: "System", Name: "Enum" };
237237
public bool IsInterface => Definition?.IsInterface ?? ((TypeAttributes & TypeAttributes.Interface) != default);
238238
public IEnumerable<ITypeInfoProvider> GenericArgumentInfoProviders => Array.Empty<ITypeInfoProvider>();

Cpp2IL.Core/Model/Contexts/WrappedTypeAnalysisContext.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ public abstract class WrappedTypeAnalysisContext : ReferencedTypeAnalysisContext
1212

1313
public override string DefaultNs => ElementType.Namespace;
1414

15+
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.
16+
1517
protected WrappedTypeAnalysisContext(TypeAnalysisContext elementType, AssemblyAnalysisContext referencedFrom) : base(referencedFrom)
1618
{
1719
ElementType = elementType;

0 commit comments

Comments
 (0)