Commit Graph

6 Commits

Author SHA1 Message Date
Max Moiseev
3a3984877a Merge remote-tracking branch 'origin/master' into swift-3-api-guidelines 2016-02-15 15:43:34 -08:00
Chris Lattner
cf1cb14205 recommit 28958/28959, there was a testcase that didn't get updated correctly
but it was between the two revisions.


Swift SVN r28964
2015-05-23 15:50:16 +00:00
Ted Kremenek
b4b81ff657 Revert "merge assignments to UnresolvedDotExpr onto the common path,"
Backing out to fix the build.

Swift SVN r28959
2015-05-23 07:55:07 +00:00
Chris Lattner
3b64718b89 merge assignments to UnresolvedDotExpr onto the common path,
this is neutral w.r.t. diagnostics quality, but deletes a ton
of code:

 include/swift/AST/DiagnosticsSema.def |   21 ++---------
 lib/Sema/CSDiag.cpp                   |   64 ++--------------------------------
 2 files changed, 9 insertions(+), 76 deletions(-)



Swift SVN r28956
2015-05-23 05:18:59 +00:00
Chris Lattner
df19d03eb7 When diagnosing invalid assignment errors, dig into the constraint system to see
if it has already resolved a member binding of an UnresolvedDotExpr.  This allows
us to give tailored diagnostics to indicate whether the destination is not an lvalue
because the property itself was immutable or when the base is immutable.

In addition to improved diagnostics, this allows us to fixit hint "let" to "var" on
property definitions, and we can even go so far as to fixit hint insert 'mutating' on 
the enclosing func decl when self is the problem.

This fixes the non-subscript cases of:
<rdar://problem/17632908> QoI: Modifying struct member in non-mutating function produces difficult to understand error message
<rdar://problem/19370429> QoI: fixit to add "mutating" when assigning to a member of self in a struct
<rdar://problem/20234955> QoI: Error message for assigning to 'let' fields should say that the error is due to a 'let' binding

Subscript cases to follow.



Swift SVN r28854
2015-05-20 22:18:52 +00:00
Joe Pamer
4d86ddc692 When checking if a decl with trivial accessors is settable, make sure it actually has a setter. Not doing so can lead to improper projections from rvalue to lvalue, and cause crashes during SIL generation. (rdar://problem/19781739)
Swift SVN r25215
2015-02-12 01:17:09 +00:00