[Diagnostics] Diagnose invalid method references in key path

This commit is contained in:
Pavel Yaskevich
2019-04-22 16:40:14 -07:00
parent d6a3a31ae9
commit 6fdb5482d4
4 changed files with 59 additions and 1 deletions

View File

@@ -2486,3 +2486,9 @@ bool InvalidMemberWithMutatingGetterInKeyPath::diagnoseAsError() {
emitDiagnostic(getLoc(), diag::expr_keypath_mutating_getter, getName());
return true;
}
bool InvalidMethodRefInKeyPath::diagnoseAsError() {
emitDiagnostic(getLoc(), diag::expr_keypath_not_property, getKind(),
getName());
return true;
}