mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-30 23:31:12 +00:00
Improve error reporting for patterns not matching opaques
This commit is contained in:
parent
4e27cdd21d
commit
07b1829732
7 changed files with 26 additions and 23 deletions
|
@ -11,7 +11,7 @@ use roc_types::{subs::Variable, types::VariableDetail};
|
|||
/// constraints makes them behaviorally different from unification-based constraints.
|
||||
#[derive(Debug, Clone, PartialEq)]
|
||||
pub enum PresenceConstraint {
|
||||
IncludesTag(TagName, Vec<Type>),
|
||||
IncludesTag(TagName, Vec<Type>, Region, PatternCategory),
|
||||
IsOpen,
|
||||
Pattern(Region, PatternCategory, PExpected<Type>),
|
||||
}
|
||||
|
@ -159,7 +159,7 @@ fn validate_help(constraint: &Constraint, declared: &Declared, accum: &mut Varia
|
|||
Constraint::Present(typ, constr) => {
|
||||
subtract(declared, &typ.variables_detail(), accum);
|
||||
match constr {
|
||||
PresenceConstraint::IncludesTag(_, tys) => {
|
||||
PresenceConstraint::IncludesTag(_, tys, _, _) => {
|
||||
for ty in tys {
|
||||
subtract(declared, &ty.variables_detail(), accum);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue