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(
145145 u. ty ( ctx. db )
146146 }
147147 hir:: PathResolution :: Def ( hir:: ModuleDef :: BuiltinType ( ty) ) => ty. ty ( ctx. db ) ,
148+ hir:: PathResolution :: Def ( hir:: ModuleDef :: TypeAlias ( ty) ) => ty. ty ( ctx. db ) ,
148149 _ => return ,
149150 } ;
150151
Original file line number Diff line number Diff line change @@ -714,3 +714,30 @@ impl Ty {
714714 "# ] ] ,
715715 ) ;
716716}
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