Skip to content

Commit 6f3e2ee

Browse files
[CSSimplify] Fail when try do simplify a key path application to a key path dynamicMemberLookup
1 parent 41958f9 commit 6f3e2ee

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

lib/Sema/CSSimplify.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7802,6 +7802,12 @@ ConstraintSystem::simplifyKeyPathApplicationConstraint(
78027802
return SolutionKind::Unsolved;
78037803
};
78047804

7805+
// When locator points to a KeyPathDynamicMemberLookup, skip the
7806+
// key path application.
7807+
if (locator.getBaseLocator()->isForKeyPathDynamicMemberLookup()) {
7808+
return SolutionKind::Error;
7809+
}
7810+
78057811
if (auto clas = keyPathTy->getAs<NominalType>()) {
78067812
if (clas->getDecl() == getASTContext().getAnyKeyPathDecl()) {
78077813
// Read-only keypath, whose projected value is upcast to `Any?`.

0 commit comments

Comments
 (0)