type_info_of allows typeid; typeid_of allows ^Type_Info; Otherwise only allow type

This commit is contained in:
gingerBill
2018-05-12 19:54:16 +01:00
parent 2ef22e86e0
commit 373a60b9ef
5 changed files with 77 additions and 46 deletions
+1 -1
View File
@@ -43,7 +43,7 @@ ptr_to_bytes :: proc "contextless" (ptr: ^$T, len := 1) -> []byte {
}
any_to_bytes :: proc "contextless" (val: any) -> []byte {
ti := type_info_from_typeid(val.typeid);
ti := type_info_of(val.typeid);
size := ti != nil ? ti.size : 0;
return transmute([]byte)raw.Slice{val.data, size};
}