fix: Make value_ty query fallible

This commit is contained in:
Lukas Wirth 2024-01-16 12:09:40 +01:00
parent 35e05e07fb
commit 8f4f5a6cce
8 changed files with 59 additions and 38 deletions

View file

@ -3786,7 +3786,9 @@ impl Type {
}
fn from_value_def(db: &dyn HirDatabase, def: impl Into<ValueTyDefId> + HasResolver) -> Type {
let ty = db.value_ty(def.into());
let Some(ty) = db.value_ty(def.into()) else {
return Type::new(db, def, TyKind::Error.intern(Interner));
};
let substs = TyBuilder::unknown_subst(
db,
match def.into() {