mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Sema: Reject unimplemented key path components during resolveKeyPathExpr.
This is a bit more robust and user-friendly than hoping more brittle recovery in SILGen or IRGen for unsupported components kicks in. rdar://problem/32200714
This commit is contained in:
@@ -2828,8 +2828,7 @@ performMemberLookup(ConstraintKind constraintKind, DeclName memberName,
|
||||
result.OverallResult = MemberLookupResult::HasResults;
|
||||
|
||||
// If we're looking for a subscript, consider key path operations.
|
||||
if (memberName.isSimpleName(getASTContext().Id_subscript)
|
||||
&& getASTContext().LangOpts.EnableExperimentalKeyPaths) {
|
||||
if (memberName.isSimpleName(getASTContext().Id_subscript)) {
|
||||
result.ViableCandidates.push_back(
|
||||
OverloadChoice(baseTy, OverloadChoiceKind::KeyPathApplication));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user