#Why is this not a compile error?

1 messages · Page 1 of 1 (latest)

opaque beacon
sweet snow
#

the type of return is noreturn which coerces to all types

#

it looks weird in this example but its an important rule for code like thing = other_thing orelse return;

spring igloo
#

noreturn is not just the return type of functions that don't return, it's more broadly the type for all values that are never actually created

#

in that example, the return t will never actually be assigned to t.disable_bindless because the function returns before then. so it may as well coerce to the type of t.disable_bindless, because the program never actually reaches the point where it matters whether the types are compatible