mirror of
https://github.com/roc-lang/roc.git
synced 2024-11-10 10:02:38 +03:00
add unreachable based on invariants
This commit is contained in:
parent
23ea151d5f
commit
4b2804019d
@ -308,7 +308,9 @@ pub const RocDec = extern struct {
|
||||
|
||||
// (n / 0) is an error
|
||||
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
|
||||
|
Loading…
Reference in New Issue
Block a user