From 41c7448e1242de8fadf7c46efd3171368b5ff92e Mon Sep 17 00:00:00 2001 From: Jonas Schievink Date: Tue, 30 Mar 2021 02:08:33 +0200 Subject: Accurately classify assoc. types in paths --- crates/ide/src/goto_definition.rs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'crates/ide') diff --git a/crates/ide/src/goto_definition.rs b/crates/ide/src/goto_definition.rs index a2c97061f..c6556c487 100644 --- a/crates/ide/src/goto_definition.rs +++ b/crates/ide/src/goto_definition.rs @@ -917,6 +917,21 @@ fn f() -> impl Iterator {} ); } + #[test] + #[should_panic = "unresolved reference"] + fn unknown_assoc_ty() { + check( + r#" +trait Iterator { + type Item; + //^^^^ +} + +fn f() -> impl Iterator {} + "#, + ) + } + #[test] fn goto_def_for_assoc_ty_in_path_multiple() { check( -- cgit v1.2.3