Remove more exhaustiveness checks in mono

This commit is contained in:
Ayaz Hafiz 2022-04-28 14:28:34 -04:00 committed by ayazhafiz
parent 12234c36ad
commit c969c7a15e

View file

@ -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);