1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-18 16:10:26 +02:00

Comptime improvments, IOn<X> interfaces, const payload enum

This commit is contained in:
Brian Fiete 2022-02-11 05:47:32 -05:00
parent e7fe91facb
commit f37fb2c1b7
20 changed files with 884 additions and 364 deletions

View file

@ -150,4 +150,31 @@ namespace System.Reflection
}
}
}
[Ordered]
struct ComptimeFieldInfo
{
int64 mNativeFieldInstance;
TypeId mOwner;
TypeId mTypeId;
int32 mFieldIdx;
FieldFlags mFlags;
public StringView Name
{
get
{
if (Compiler.IsComptime)
return Type.[Friend]Comptime_Field_GetName(mNativeFieldInstance);
return "?";
}
}
public Type Owner => Type.[Friend]GetType_((.)mOwner);
public Type FieldType => Type.[Friend]GetType_((.)mTypeId);
public int FieldIdx => mFieldIdx;
public bool IsConst => mFlags.HasFlag(.Const);
public bool IsStatic => mFlags.HasFlag(.Static);
public bool IsInstanceField => !mFlags.HasFlag(.Static) && !mFlags.HasFlag(.Const);
}
}