Skip to content

Commit 4fb0a98

Browse files
jackh726compiler-errors
authored andcommitted
When a or b is an error, relate ok
1 parent a0ebd5d commit 4fb0a98

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

chalk-solve/src/infer/unify.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,8 @@ impl<'t, I: Interner> Unifier<'t, I> {
195195
self.relate_var_ty(variance.invert(), var, kind, &ty)
196196
}
197197

198+
(TyKind::Error, _) | (_, TyKind::Error) => Ok(()),
199+
198200
// This would correspond to unifying a `fn` type with a non-fn
199201
// type in Rust; error.
200202
(&TyKind::Function(_), _) | (_, &TyKind::Function(_)) => Err(NoSolution),
@@ -349,7 +351,6 @@ impl<'t, I: Interner> Unifier<'t, I> {
349351
(TyKind::Foreign(id_a), TyKind::Foreign(id_b)) => {
350352
Zip::zip_with(self, variance, id_a, id_b)
351353
}
352-
(TyKind::Error, TyKind::Error) => Ok(()),
353354

354355
(_, _) => Err(NoSolution),
355356
}

0 commit comments

Comments
 (0)