Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/ide-completion/src/context/tests.rs')
| -rw-r--r-- | crates/ide-completion/src/context/tests.rs | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/crates/ide-completion/src/context/tests.rs b/crates/ide-completion/src/context/tests.rs index 94d904932a..1d1a55c6fe 100644 --- a/crates/ide-completion/src/context/tests.rs +++ b/crates/ide-completion/src/context/tests.rs @@ -329,6 +329,27 @@ fn foo(x: Foo) -> Foo { "#, expect![[r#"ty: u32, name: ?"#]], ); + + check_expected_type_and_name( + r#" +//- minicore: option +struct Foo<T>(T); +fn foo(x: Foo<Option<i32>>) -> Foo { + match x { Foo($0) => () } +} +"#, + expect![[r#"ty: Option<i32>, name: ?"#]], + ); + check_expected_type_and_name( + r#" +//- minicore: option +enum Foo<T> { Var(T) }; +fn foo(x: Foo<Option<i32>>) -> Foo { + match x { Foo::Var($0) => () } +} +"#, + expect![[r#"ty: Option<i32>, name: ?"#]], + ); } #[test] |