diff options
Diffstat (limited to 'crates/ide')
-rw-r--r-- | crates/ide/src/inlay_hints.rs | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/crates/ide/src/inlay_hints.rs b/crates/ide/src/inlay_hints.rs index 49d8e4ae1..adb93efd7 100644 --- a/crates/ide/src/inlay_hints.rs +++ b/crates/ide/src/inlay_hints.rs | |||
@@ -1235,4 +1235,25 @@ fn main() { | |||
1235 | "#, | 1235 | "#, |
1236 | ); | 1236 | ); |
1237 | } | 1237 | } |
1238 | |||
1239 | #[test] | ||
1240 | fn infer_call_method_return_associated_types_with_generic() { | ||
1241 | check( | ||
1242 | r#" | ||
1243 | pub trait Default { | ||
1244 | fn default() -> Self; | ||
1245 | } | ||
1246 | pub trait Foo { | ||
1247 | type Bar: Default; | ||
1248 | } | ||
1249 | |||
1250 | pub fn quux<T: Foo>() -> T::Bar { | ||
1251 | let y = Default::default(); | ||
1252 | //^ <T as Foo>::Bar | ||
1253 | |||
1254 | y | ||
1255 | } | ||
1256 | "#, | ||
1257 | ); | ||
1258 | } | ||
1238 | } | 1259 | } |