Skip to content

Commit 76ee456

Browse files
authored
Merge pull request swiftlang#66589 from hborla/generic-env-context-substitutions
[GenericEnvironment] Don't apply outer context substitutions before `type.subst` in `mapTypeIntoContext`.
2 parents 18798b6 + d6fe625 commit 76ee456

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

lib/AST/GenericEnvironment.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -635,7 +635,6 @@ Type GenericEnvironment::mapTypeIntoContext(
635635
assert((!type->hasArchetype() || type->hasLocalArchetype()) &&
636636
"already have a contextual type");
637637

638-
type = maybeApplyOuterContextSubstitutions(type);
639638
Type result = type.subst(QueryInterfaceTypeSubstitutions(this),
640639
lookupConformance,
641640
SubstFlags::AllowLoweredTypes |

test/Constraints/pack-expansion-expressions.swift

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -553,3 +553,11 @@ do {
553553
_ = (repeat overloaded(1, each a))
554554
}
555555
}
556+
557+
func configure<T, each Element>(
558+
_ item: T,
559+
with configuration: repeat (ReferenceWritableKeyPath<T, each Element>, each Element)
560+
) -> T {
561+
repeat item[keyPath: (each configuration).0] = (each configuration).1
562+
return item
563+
}

0 commit comments

Comments
 (0)