add unreachable based on invariants

This commit is contained in:
Folkert 2021-07-18 22:54:03 +02:00
parent 23ea151d5f
commit 4b2804019d

View file

@ -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