Skip to content

Commit

Permalink
Resolve a consistency issue where Cecil considers nint and nuint prim…
Browse files Browse the repository at this point in the history
…itive
  • Loading branch information
ds5678 committed Jul 12, 2024
1 parent 5e58d9e commit 676db2a
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions Il2CppInterop.Generator/Extensions/AsmResolverExtensions.cs
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
using AsmResolver.DotNet;
using AsmResolver.DotNet.Code.Cil;
using AsmResolver.DotNet.Collections;
using AsmResolver.DotNet.Signatures;
using AsmResolver.PE.DotNet.Cil;
using AsmResolver.PE.DotNet.Metadata.Tables;

namespace Il2CppInterop.Generator.Extensions;

namespace Il2CppInterop.Generator.Extensions;

internal static class AsmResolverExtensions
{
public static bool IsPrimitive(this TypeSignature type)
{
return type is CorLibTypeSignature { ElementType: >= ElementType.Boolean and <= ElementType.R8 };
//https://github.com/jbevain/cecil/blob/8e1ae7b4ea67ccc38cb8db3ded6802643109ffd7/Mono.Cecil/TypeReference.cs#L286
return type is CorLibTypeSignature { ElementType: >= ElementType.Boolean and <= ElementType.R8 or ElementType.I or ElementType.U };
}

public static TypeSignature GetElementType(this TypeSignature type) => type switch
Expand Down

0 comments on commit 676db2a

Please sign in to comment.