We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 2b61be2 commit ad17ba1Copy full SHA for ad17ba1
2 files changed
crates/ide-completion/src/completions/pattern.rs
@@ -145,6 +145,7 @@ pub(crate) fn complete_pattern_path(
145
u.ty(ctx.db)
146
}
147
hir::PathResolution::Def(hir::ModuleDef::BuiltinType(ty)) => ty.ty(ctx.db),
148
+ hir::PathResolution::Def(hir::ModuleDef::TypeAlias(ty)) => ty.ty(ctx.db),
149
_ => return,
150
};
151
crates/ide-completion/src/tests/pattern.rs
@@ -714,3 +714,30 @@ impl Ty {
714
"#]],
715
);
716
717
+
718
+#[test]
719
+fn through_alias() {
720
+ check_empty(
721
+ r#"
722
+enum Enum<T> {
723
+ Unit,
724
+ Tuple(T),
725
+}
726
727
+type EnumAlias<T> = Enum<T>;
728
729
+fn f(x: EnumAlias<u8>) {
730
+ match x {
731
+ EnumAlias::$0 => (),
732
+ _ => (),
733
+ }
734
735
736
737
+"#,
738
+ expect![[r#"
739
+ bn Tuple(…) Tuple($1)$0
740
+ bn Unit Unit$0
741
+ "#]],
742
+ );
743
0 commit comments