Make unreachable() a built-in compiler-level procedure

This commit is contained in:
gingerBill
2022-08-05 11:57:33 +01:00
parent 8171f8209a
commit 576914aee1
5 changed files with 19 additions and 20 deletions
-14
View File
@@ -785,17 +785,3 @@ unimplemented :: proc(message := "", loc := #caller_location) -> ! {
}
p("not yet implemented", message, loc)
}
@builtin
@(disabled=ODIN_DISABLE_ASSERT)
unreachable :: proc(message := "", loc := #caller_location) -> ! {
p := context.assertion_failure_proc
if p == nil {
p = default_assertion_failure_proc
}
if message != "" {
p("internal error", message, loc)
} else {
p("internal error", "entered unreachable code", loc)
}
}