Handle TyAlias in projected_ty

This commit is contained in:
Ali Bektas 2023-07-15 18:32:21 +02:00
parent 789dfd2a25
commit 75f06ce1fb

View File

@ -151,6 +151,7 @@ impl<V, T> ProjectionElem<V, T> {
TyKind::Adt(_, subst) => {
db.field_types(f.parent)[f.local_id].clone().substitute(Interner, subst)
}
TyKind::Alias(al) => al.clone().intern(Interner),
_ => {
never!("Only adt has field");
return TyKind::Error.intern(Interner);
@ -167,6 +168,7 @@ impl<V, T> ProjectionElem<V, T> {
TyKind::Error.intern(Interner)
}),
TyKind::Closure(id, subst) => closure_field(*id, subst, *f),
TyKind::Alias(al) => al.clone().intern(Interner),
_ => {
never!("Only tuple or closure has tuple or closure field");
return TyKind::Error.intern(Interner);