File tree Expand file tree Collapse file tree 2 files changed +32
-0
lines changed
crates/ide-completion/src Expand file tree Collapse file tree 2 files changed +32
-0
lines changed Original file line number Diff line number Diff line change @@ -101,6 +101,7 @@ pub(crate) fn complete_pattern(
101101 hir:: ModuleDef :: Const ( ..) => refutable,
102102 hir:: ModuleDef :: Module ( ..) => true ,
103103 hir:: ModuleDef :: Macro ( mac) => mac. is_fn_like ( ctx. db ) ,
104+ hir:: ModuleDef :: TypeAlias ( _) => true ,
104105 _ => false ,
105106 } ,
106107 hir:: ScopeDef :: ImplSelfType ( impl_) => match impl_. self_ty ( ctx. db ) . as_adt ( ) {
Original file line number Diff line number Diff line change @@ -821,6 +821,37 @@ fn f(x: EnumAlias<u8>) {
821821 ) ;
822822}
823823
824+ #[ test]
825+ fn through_alias_it_self ( ) {
826+ check (
827+ r#"
828+ enum Enum<T> {
829+ Unit,
830+ Tuple(T),
831+ }
832+
833+ type EnumAlias<T> = Enum<T>;
834+
835+ fn f(x: EnumAlias<u8>) {
836+ match x {
837+ $0 => (),
838+ _ => (),
839+ }
840+
841+ }
842+
843+ "# ,
844+ expect ! [ [ r#"
845+ en Enum
846+ ta EnumAlias
847+ bn Enum::Tuple(…) Enum::Tuple($1)$0
848+ bn Enum::Unit Enum::Unit$0
849+ kw mut
850+ kw ref
851+ "# ] ] ,
852+ ) ;
853+ }
854+
824855#[ test]
825856fn pat_no_unstable_item_on_stable ( ) {
826857 check (
You can’t perform that action at this time.
0 commit comments