Closed karl-zylinski closed 3 days ago
Doing type_of(nil) or type_of(5) now gives a proper error instead of tripping an internal assertion.
type_of(nil)
type_of(5)
This fixes #1180 since bug := typeid_of(type_of(nil)) cannot get past the type_of part anymore.
bug := typeid_of(type_of(nil))
type_of
type_of(nil) gives:
C:\Odin\src\types.cpp(3677): Assertion Failure: `is_type_typed(t)` untyped nil
type_of(5) gives:
C:\Odin\src\types.cpp(3677): Assertion Failure: `is_type_typed(t)` untyped integer
type_of(nil) =>
C:/bug_repros/typeid_bug/typeid_bug.odin(6:27) Error: 'type_of' of untyped nil cannot be determined bug := typeid_of(type_of(nil)) ^~^
type_of(5) =>
C:/bug_repros/typeid_bug/typeid_bug.odin(7:28) Error: 'type_of' of untyped integer cannot be determined bug2 := typeid_of(type_of(5)) ^
Doing
type_of(nil)
ortype_of(5)
now gives a proper error instead of tripping an internal assertion.This fixes #1180 since
bug := typeid_of(type_of(nil))
cannot get past thetype_of
part anymore.Old behavior
type_of(nil)
gives:type_of(5)
gives:New behavior
type_of(nil)
=>type_of(5)
=>