1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-19 00:20:25 +02:00

Separated comptime mixin into Compiler.Mixin and Compiler.MixinRoot

This commit is contained in:
Brian Fiete 2022-02-01 16:35:09 -05:00
parent 21366d48ec
commit 6c18ffd607
3 changed files with 71 additions and 52 deletions

View file

@ -267,7 +267,7 @@ namespace System
static extern void Comptime_EmitAddInterface(int32 typeId, int32 ifaceTypeId);
static extern void Comptime_EmitMethodEntry(int64 methodHandle, StringView text);
static extern void Comptime_EmitMethodExit(int64 methodHandle, StringView text);
static extern void Comptime_EmitMixin(StringView text);
static extern void Comptime_EmitMixin(String text);
[Comptime(OnlyFromComptime=true)]
public static MethodBuilder CreateMethod(Type owner, StringView methodName, Type returnType, MethodFlags methodFlags)
@ -301,8 +301,15 @@ namespace System
Comptime_EmitMethodExit(methodHandle.mNativeMethodInstance, text);
}
[Comptime(ConstEval=true)]
public static void Mixin(String text)
{
if (Compiler.IsComptime)
Comptime_EmitMixin(text);
}
[Comptime]
public static void Mixin(StringView text)
public static void MixinRoot(String text)
{
if (Compiler.IsComptime)
Comptime_EmitMixin(text);