mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-28 06:14:46 +00:00
add unreachable based on invariants
This commit is contained in:
parent
23ea151d5f
commit
4b2804019d
1 changed files with 3 additions and 1 deletions
|
@ -308,7 +308,9 @@ pub const RocDec = extern struct {
|
||||||
|
|
||||||
// (n / 0) is an error
|
// (n / 0) is an error
|
||||||
if (denominator_i128 == 0) {
|
if (denominator_i128 == 0) {
|
||||||
@panic("TODO runtime exception for divide by 0!");
|
// The compiler frontend does the `denominator == 0` check for us,
|
||||||
|
// therefore this case is unreachable from roc user code
|
||||||
|
unreachable;
|
||||||
}
|
}
|
||||||
|
|
||||||
// If they're both negative, or if neither is negative, the final answer
|
// If they're both negative, or if neither is negative, the final answer
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue