Skip to content

Commit 48b0a36

Browse files
committed
Handle impl/dyn Trait in match_ty
1 parent 7026d42 commit 48b0a36

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

chalk-solve/src/clauses.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,14 @@ fn match_ty(
278278
Ty::ForAll(quantified_ty) => match_ty(db, environment, &quantified_ty.ty, clauses),
279279
Ty::BoundVar(_) => {}
280280
Ty::InferenceVar(_) => panic!("should have floundered"),
281+
Ty::Dyn(qwc) => {
282+
let wc = qwc.substitute(&[ty.clone().cast()]);
283+
clauses.extend(wc.into_iter().casted());
284+
}
285+
Ty::Opaque(qwc) => {
286+
let wc = qwc.substitute(&[ty.clone().cast()]);
287+
clauses.extend(wc.into_iter().casted());
288+
}
281289
}
282290
}
283291

0 commit comments

Comments
 (0)