Commit Graph

5 Commits

Author SHA1 Message Date
Chris Lattner
17623e44bb This got fixed along the way <rdar://problem/22507759> QoI: poor error message for invalid unsafeDowncast()
Swift SVN r31713
2015-09-05 20:24:16 +00:00
Chris Lattner
9d9b8aaf35 move protocol conformance errors away from being diagnosed as a Failure, instead
putting it into the expr diagnostics path, allowing more contextual messages.


Swift SVN r30920
2015-08-01 18:31:59 +00:00
Chris Lattner
97e6a50148 Start using contextual information from function calls to diagnose issues in their
argument.  For now we start with some of the most simple cases: single argument 
calls.  This dramatically improves the QoI for error messages in argument lists,
typically turning a error+note combo into a single specific error message.

Some minor improvements coming (and also generalizing this to n-ary calls), but it 
is nice that all the infrastructure is starting to come together...



Swift SVN r30905
2015-08-01 04:37:52 +00:00
Chris Lattner
ede0c50856 Revamp how value & type member constraint failures are diagnosed, eliminating the
"unavoidable failure" path, along with Failure::DoesNotHaveNonMutatingMember and
just doing some basic disambiguation in CSDiags.

This provides some benefits:
 - Allows us to plug in much more specific diagnostics for the existing "only has 
   mutating members" diagnostic, including producing notes for why the base expr
   isn't mutable (see e.g. test/Sema/immutability.swift diffs).
 - Corrects issues where we'd drop full decl name info for selector references.
 - Wordsmiths diagnostics to not complain about "values of type Foo.Type" instead 
   complaining about "type Foo"
 - Where before we would diagnose all failures with "has no member named", we now
   distinguish between when there is no member, and when you can't use it.  When you
   can't use it, you get a vauge "cannot use it" diagnostic, but...
 - This provides an infrastructure for diagnosing other kinds of problems (e.g. 
   trying to use a private member or a static member from an instance).
 - Improves a number of cases where failed type member constraints would produce uglier
   diagnostics than a different constraint failure would.
 - Resolves a number of rdars, e.g. (and probably others):
   <rdar://problem/20294245> QoI: Error message mentions value rather than key for subscript



Swift SVN r30715
2015-07-28 07:04:22 +00:00
Joe Groff
190251fd64 Sema: Don't diagnose casts from NSObject to potentially-class metatypes.
Now that rdar://problem/16238475 is fixed, it's no longer true that these casts never succeed in the ObjC runtime.

Swift SVN r29997
2015-07-08 23:23:35 +00:00