[Diagnostics] Add a diagnostic for invalid mutating member ref on r-value base

This commit is contained in:
Pavel Yaskevich
2019-07-08 16:45:55 -07:00
parent 1e8ae99008
commit 78e2e93c6b
3 changed files with 72 additions and 18 deletions

View File

@@ -645,7 +645,9 @@ bool SkipUnhandledConstructInFunctionBuilder::diagnose(Expr *root,
}
bool AllowMutatingMemberOrRValueBase::diagnose(Expr *root, bool asNote) const {
return false;
auto &cs = getConstraintSystem();
MutatingMemberRefOnImmutableBase failure(root, cs, getMember(), getLocator());
return failure.diagnose(asNote);
}
AllowMutatingMemberOrRValueBase *