Type as value initially working

This commit is contained in:
Krzosa Karol
2022-06-18 23:49:47 +02:00
parent 523760dc0a
commit 9d2ce3560b
5 changed files with 13 additions and 2 deletions

View File

@@ -66,7 +66,8 @@ Type_Info :: struct
type_infos_len: S32 #foreign
type_infos : *Type_Info #foreign
get_type_info :: (id: Type_ID): *Type_Info
get_type_info :: (type: Type): *Type_Info
id := type->S32
if id >= type_infos_len
return 0
return type_infos + id

View File

@@ -60,7 +60,7 @@ WinMain :: (hInstance: HINSTANCE, hPrevInstance: HINSTANCE, lpCmdLine: LPSTR, nS
if good_scheduling := false, timeBeginPeriod(1) == TIMERR_NOERROR
good_scheduling = true
char_info := get_type_info(5)
char_info := get_type_info(char)
assert(char_info.kind == Type_Info_Kind.CHAR)
arena: Arena