diff --git a/lib/AST/GenericEnvironment.cpp b/lib/AST/GenericEnvironment.cpp index 88957a6abe737..aecf75826e670 100644 --- a/lib/AST/GenericEnvironment.cpp +++ b/lib/AST/GenericEnvironment.cpp @@ -635,7 +635,6 @@ Type GenericEnvironment::mapTypeIntoContext( assert((!type->hasArchetype() || type->hasLocalArchetype()) && "already have a contextual type"); - type = maybeApplyOuterContextSubstitutions(type); Type result = type.subst(QueryInterfaceTypeSubstitutions(this), lookupConformance, SubstFlags::AllowLoweredTypes | diff --git a/test/Constraints/pack-expansion-expressions.swift b/test/Constraints/pack-expansion-expressions.swift index 22de5f7b3b5df..b47a94b2bec48 100644 --- a/test/Constraints/pack-expansion-expressions.swift +++ b/test/Constraints/pack-expansion-expressions.swift @@ -552,3 +552,11 @@ do { _ = (repeat overloaded(1, each a)) } } + +func configure( + _ item: T, + with configuration: repeat (ReferenceWritableKeyPath, each Element) +) -> T { + repeat item[keyPath: (each configuration).0] = (each configuration).1 + return item +}