mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-28 22:34:45 +00:00
Move exhaustiveness checking to type solving phase with solve tests
This commit is contained in:
parent
9602b3634c
commit
356616d834
13 changed files with 678 additions and 42 deletions
|
@ -100,6 +100,7 @@ pub enum TypeError {
|
|||
ErrorType,
|
||||
Vec<IncompleteAbilityImplementation>,
|
||||
),
|
||||
Exhaustive(roc_exhaustive::Error),
|
||||
}
|
||||
|
||||
use roc_types::types::Alias;
|
||||
|
@ -1196,6 +1197,16 @@ fn solve(
|
|||
}
|
||||
}
|
||||
}
|
||||
Exhaustive(rows_index, context) => {
|
||||
let sketched_rows = constraints.sketched_rows[rows_index.index()].clone();
|
||||
|
||||
let checked = roc_can::exhaustive::check(&subs, sketched_rows, *context);
|
||||
if let Err(errors) = checked {
|
||||
problems.extend(errors.into_iter().map(TypeError::Exhaustive));
|
||||
}
|
||||
|
||||
state
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue