This repository was archived by the owner on May 28, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +40
-0
lines changed Expand file tree Collapse file tree 2 files changed +40
-0
lines changed Original file line number Diff line number Diff line change @@ -1200,6 +1200,12 @@ impl<'a> InferenceContext<'a> {
12001200 path : & ModPath ,
12011201 ) -> ( Ty , Option < VariantId > ) {
12021202 let remaining = unresolved. map ( |it| path. segments ( ) [ it..] . len ( ) ) . filter ( |it| it > & 0 ) ;
1203+ let ty = match ty. kind ( Interner ) {
1204+ TyKind :: Alias ( AliasTy :: Projection ( proj_ty) ) => {
1205+ self . db . normalize_projection ( proj_ty. clone ( ) , self . table . trait_env . clone ( ) )
1206+ }
1207+ _ => ty,
1208+ } ;
12031209 match remaining {
12041210 None => {
12051211 let variant = ty. as_adt ( ) . and_then ( |( adt_id, _) | match adt_id {
Original file line number Diff line number Diff line change @@ -1154,6 +1154,40 @@ fn main() {
11541154 ) ;
11551155}
11561156
1157+ #[ test]
1158+ fn generic_alias_with_qualified_path ( ) {
1159+ check_types (
1160+ r#"
1161+ type Wrap<T> = T;
1162+
1163+ struct S;
1164+
1165+ trait Schematic {
1166+ type Props;
1167+ }
1168+
1169+ impl Schematic for S {
1170+ type Props = X;
1171+ }
1172+
1173+ enum X {
1174+ A { cool: u32, stuff: u32 },
1175+ B,
1176+ }
1177+
1178+ fn main() {
1179+ let wrapped = Wrap::<<S as Schematic>::Props>::A {
1180+ cool: 100,
1181+ stuff: 100,
1182+ };
1183+
1184+ if let Wrap::<<S as Schematic>::Props>::A { cool, ..} = &wrapped {}
1185+ //^^^^ &u32
1186+ }
1187+ "# ,
1188+ ) ;
1189+ }
1190+
11571191#[ test]
11581192fn type_mismatch_pat_const_reference ( ) {
11591193 check_no_mismatches (
You can’t perform that action at this time.
0 commit comments