Accurately classify assoc. types in paths

This commit is contained in:
Jonas Schievink 2021-03-30 02:08:33 +02:00
parent b3ca06e4fd
commit 41c7448e12
2 changed files with 38 additions and 18 deletions

View file

@ -917,6 +917,21 @@ fn f() -> impl Iterator<Item$0 = u8> {}
);
}
#[test]
#[should_panic = "unresolved reference"]
fn unknown_assoc_ty() {
check(
r#"
trait Iterator {
type Item;
//^^^^
}
fn f() -> impl Iterator<Invalid$0 = u8> {}
"#,
)
}
#[test]
fn goto_def_for_assoc_ty_in_path_multiple() {
check(