Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/ide-completion/src/tests/pattern.rs')
-rw-r--r--crates/ide-completion/src/tests/pattern.rs29
1 files changed, 29 insertions, 0 deletions
diff --git a/crates/ide-completion/src/tests/pattern.rs b/crates/ide-completion/src/tests/pattern.rs
index 8af6cce98f..b2e8274a84 100644
--- a/crates/ide-completion/src/tests/pattern.rs
+++ b/crates/ide-completion/src/tests/pattern.rs
@@ -355,6 +355,35 @@ fn outer(Foo { bar$0 }: Foo) {}
}
#[test]
+fn completes_in_record_field_pat_with_generic_type_alias() {
+ check_empty(
+ r#"
+type Wrap<T> = T;
+
+enum X {
+ A { cool: u32, stuff: u32 },
+ B,
+}
+
+fn main() {
+ let wrapped = Wrap::<X>::A {
+ cool: 100,
+ stuff: 100,
+ };
+
+ if let Wrap::<X>::A { $0 } = &wrapped {};
+}
+"#,
+ expect![[r#"
+ fd cool u32
+ fd stuff u32
+ kw mut
+ kw ref
+ "#]],
+ )
+}
+
+#[test]
fn completes_in_fn_param() {
check_empty(
r#"