Addin @varcast

This commit is contained in:
Christoffer Lerno
2022-03-27 13:09:06 +02:00
parent b31629c5e8
commit 78134316b7

View File

@@ -10,6 +10,12 @@ macro scope(&variable; @body) @autoimport
@body();
}
macro varcast(variant v, $Type) @autoimport
{
if (v.type != $Type.typeid) return null;
return ($Type*)v.ptr;
}
extern fn void printf(char*, ...);
struct CallstackElement