mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-27 22:09:09 +00:00
Improve non-exhaustive typechecking errors
We will replace this with proper exhaustiveness checking when we have that in the typechecking phase, but for now this should do.
This commit is contained in:
parent
87245def0a
commit
9a341e3d75
3 changed files with 99 additions and 60 deletions
|
@ -708,7 +708,9 @@ pub fn constrain_expr(
|
|||
|
||||
// After solving the condition variable with what's expected from the branch patterns,
|
||||
// check it against the condition expression.
|
||||
// This is basically exhaustiveness checking, but doesn't check for redundancy.
|
||||
// TODO: when we have exhaustiveness checking during the typechecking phase, perform
|
||||
// exhaustiveness checking when this expectation fails. That will produce better error
|
||||
// messages.
|
||||
let cond_constraint = constrain_expr(
|
||||
constraints,
|
||||
env,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue