mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-27 13:59:08 +00:00
Remove more exhaustiveness checks in mono
This commit is contained in:
parent
12234c36ad
commit
c969c7a15e
1 changed files with 0 additions and 37 deletions
|
@ -3310,24 +3310,6 @@ pub fn with_hole<'a>(
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
let context = roc_exhaustive::Context::BadDestruct;
|
|
||||||
match crate::exhaustive::check(
|
|
||||||
def.loc_pattern.region,
|
|
||||||
&[(
|
|
||||||
Loc::at(def.loc_pattern.region, mono_pattern.clone()),
|
|
||||||
roc_exhaustive::Guard::NoGuard,
|
|
||||||
)],
|
|
||||||
context,
|
|
||||||
) {
|
|
||||||
Ok(_) => {}
|
|
||||||
Err(errors) => {
|
|
||||||
for error in errors {
|
|
||||||
env.problems.push(MonoProblem::PatternProblem(error))
|
|
||||||
}
|
|
||||||
} // TODO make all variables bound in the pattern evaluate to a runtime error
|
|
||||||
// return Stmt::RuntimeError("TODO non-exhaustive pattern");
|
|
||||||
}
|
|
||||||
|
|
||||||
let mut hole = hole;
|
let mut hole = hole;
|
||||||
|
|
||||||
for (symbol, variable, expr) in assignments {
|
for (symbol, variable, expr) in assignments {
|
||||||
|
@ -5720,25 +5702,6 @@ pub fn from_can<'a>(
|
||||||
hole,
|
hole,
|
||||||
)
|
)
|
||||||
} else {
|
} else {
|
||||||
let context = roc_exhaustive::Context::BadDestruct;
|
|
||||||
match crate::exhaustive::check(
|
|
||||||
def.loc_pattern.region,
|
|
||||||
&[(
|
|
||||||
Loc::at(def.loc_pattern.region, mono_pattern.clone()),
|
|
||||||
roc_exhaustive::Guard::NoGuard,
|
|
||||||
)],
|
|
||||||
context,
|
|
||||||
) {
|
|
||||||
Ok(_) => {}
|
|
||||||
Err(errors) => {
|
|
||||||
for error in errors {
|
|
||||||
env.problems.push(MonoProblem::PatternProblem(error))
|
|
||||||
}
|
|
||||||
|
|
||||||
return Stmt::RuntimeError("TODO non-exhaustive pattern");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// convert the continuation
|
// convert the continuation
|
||||||
let mut stmt = from_can(env, variable, cont.value, procs, layout_cache);
|
let mut stmt = from_can(env, variable, cont.value, procs, layout_cache);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue