mirror of
https://github.com/odin-lang/Odin.git
synced 2026-10-11 15:27:06 -04:00
Add reflect.any_base reflect.any_core
This commit is contained in:
1 parent
e6d8fbf194
commit
931fdd2dca
1 file changed
+15
@@ -157,6 +157,21 @@ typeid_core :: proc(id: typeid) -> typeid {
|
||||
}
|
||||
typeid_base_without_enum :: typeid_core
|
||||
|
||||
any_base :: proc(v: any) -> any {
|
||||
v := v
|
||||
if v != nil {
|
||||
v.id = typeid_base(v.id)
|
||||
}
|
||||
return v
|
||||
}
|
||||
any_core :: proc(v: any) -> any {
|
||||
v := v
|
||||
if v != nil {
|
||||
v.id = typeid_core(v.id)
|
||||
}
|
||||
return v
|
||||
}
|
||||
|
||||
typeid_elem :: proc(id: typeid) -> typeid {
|
||||
ti := type_info_of(id)
|
||||
if ti == nil { return nil }
|
||||
|
||||
Reference in new issue
Block a user