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:
Joe Groff
2017-05-15 14:09:44 -07:00
parent 69a7ef6e2d
commit faa6bc72f0
17 changed files with 63 additions and 18 deletions

View File

@@ -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));
}