Fix missing match arm false error on unknown type

This commit is contained in:
CAD97 2020-08-17 13:27:12 -04:00
parent 2eaf79cfbb
commit c822bb68ce
2 changed files with 2 additions and 4 deletions

View file

@ -223,10 +223,10 @@ impl<'a, 'b> ExprValidator<'a, 'b> {
db.body_with_source_map(self.owner.into());
let match_expr_ty = match infer.type_of_expr.get(match_expr) {
Some(ty) => ty,
// If we can't resolve the type of the match expression
// we cannot perform exhaustiveness checks.
None => return,
None | Some(Ty::Unknown) => return,
Some(ty) => ty,
};
let cx = MatchCheckCtx { match_expr, body, infer: infer.clone(), db };