File tree Expand file tree Collapse file tree 2 files changed +28
-0
lines changed
crates/ide-completion/src Expand file tree Collapse file tree 2 files changed +28
-0
lines changed Original file line number Diff line number Diff line change @@ -145,6 +145,7 @@ pub(crate) fn complete_pattern_path(
145
145
u. ty ( ctx. db )
146
146
}
147
147
hir:: PathResolution :: Def ( hir:: ModuleDef :: BuiltinType ( ty) ) => ty. ty ( ctx. db ) ,
148
+ hir:: PathResolution :: Def ( hir:: ModuleDef :: TypeAlias ( ty) ) => ty. ty ( ctx. db ) ,
148
149
_ => return ,
149
150
} ;
150
151
Original file line number Diff line number Diff line change @@ -714,3 +714,30 @@ impl Ty {
714
714
"# ] ] ,
715
715
) ;
716
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
+ }
You can’t perform that action at this time.
0 commit comments