mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-10 12:32:20 +02:00
Fixed comptime emission for enums
This commit is contained in:
parent
c52ef256a5
commit
ed80a8d88b
3 changed files with 30 additions and 4 deletions
|
@ -6,11 +6,25 @@ namespace Tests
|
|||
{
|
||||
class Reflection2
|
||||
{
|
||||
public typealias RemovePtr<T> = comptype(RemovePtr(typeof(T)));
|
||||
|
||||
[Comptime]
|
||||
public static Type RemovePtr(Type type)
|
||||
{
|
||||
if (type.IsPointer)
|
||||
return type.UnderlyingType;
|
||||
|
||||
return type;
|
||||
}
|
||||
|
||||
[Test]
|
||||
public static void TestBasics()
|
||||
{
|
||||
const Type t = typeof(StringView);
|
||||
int fieldCount = t.FieldCount;
|
||||
|
||||
Test.Assert(typeof(RemovePtr<int32>) == typeof(int32));
|
||||
Test.Assert(typeof(RemovePtr<uint32*>) == typeof(uint32));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue