File tree Expand file tree Collapse file tree 2 files changed +25
-2
lines changed Expand file tree Collapse file tree 2 files changed +25
-2
lines changed Original file line number Diff line number Diff line change @@ -7104,8 +7104,11 @@ static bool isDependentMemberTypeWithBaseThatContainsUnresolvedPackExpansions(
71047104 if (!type->is<DependentMemberType>())
71057105 return false;
71067106
7107- auto baseTy = cs.getFixedTypeRecursive(type->getDependentMemberRoot(),
7108- /*wantRValue=*/true);
7107+ // FIXME: It's really unfortunate we need to use `simplifyType` here since
7108+ // this is called from `matchTypes`. We need to completely simplify the type
7109+ // though since pack expansions can be present in fixed types for nested
7110+ // type vars.
7111+ auto baseTy = cs.simplifyType(type->getDependentMemberRoot());
71097112 llvm::SmallPtrSet<TypeVariableType *, 2> typeVars;
71107113 baseTy->getTypeVariables(typeVars);
71117114 return llvm::any_of(typeVars, [](const TypeVariableType *typeVar) {
Original file line number Diff line number Diff line change @@ -833,3 +833,23 @@ func test_dependent_members() {
833833 return Variadic . f ( c1, c2) // Ok
834834 }
835835}
836+
837+ protocol P2 {
838+ associatedtype X
839+ }
840+
841+ extension P2 {
842+ func foo( ) where X == Bool { }
843+ func foo( ) where X == String { }
844+ }
845+
846+ do {
847+ struct S < each E > : P2 {
848+ typealias X = String
849+ init ( _ fn: ( ) -> ( repeat each E ) ) { }
850+ }
851+
852+ func foo( _ x: Int ) {
853+ S { x } . foo ( ) // Make sure we can pick the right 'foo' here.
854+ }
855+ }
You can’t perform that action at this time.
0 commit comments