Fix assertion failure in type inference (#13352)
This commit is contained in:
parent
476d043874
commit
8862fe6ff2
@ -2807,6 +2807,10 @@ fn from_def(db: &dyn HirDatabase, def: impl HasResolver + Into<TyDefId>) -> Type
|
||||
let subst = TyBuilder::subst_for_def(db, id, None).fill_with_unknown().build();
|
||||
Some(subst)
|
||||
}
|
||||
ItemContainerId::ImplId(id) => {
|
||||
let subst = TyBuilder::subst_for_def(db, id, None).fill_with_unknown().build();
|
||||
Some(subst)
|
||||
}
|
||||
_ => None,
|
||||
},
|
||||
_ => None,
|
||||
|
@ -1373,6 +1373,22 @@ fn main() {
|
||||
().func$0();
|
||||
//^^^^
|
||||
}
|
||||
"#,
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_assoc_type_highlighting() {
|
||||
check(
|
||||
r#"
|
||||
trait Trait {
|
||||
type Output;
|
||||
// ^^^^^^
|
||||
}
|
||||
impl Trait for () {
|
||||
type Output$0 = ();
|
||||
// ^^^^^^
|
||||
}
|
||||
"#,
|
||||
);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user