Commit Graph

4 Commits

Author SHA1 Message Date
Doug Gregor
3638f78723 Fix the Fix-It location for insertion of @objc (rdar://problem/19879598).
This is a band-aid; all declarations should consider attributes in
their source range calculations.

Swift SVN r25379
2015-02-18 23:00:20 +00:00
Doug Gregor
2bf69a0ea0 Require witnesses for @objc requirements to be @objc.
Previously, we attempted to infer @objc-ness based on conformance, but
doing so is fraught with ordering dependencies, and just doesn't work
in the general case. Among other crimes, this allowed us to
retroactively mark a non-@objc method from an imported module as
@objc... even though nobody would ever then emit the @objc entry
points for it.

Fixes the rest of rdar://problem/18383574.

Swift SVN r24831
2015-01-29 22:53:53 +00:00
Doug Gregor
9abe8f717c Diagnose Objective-C conflicts due to unsatisfied, optional @objc requirements.
An optional @objc requirement within a protocol can be left
unsatisfied in a well-formed program. However, there may still be a
conflict within the Objective-C runtime if the conforming class
defines a method with the corresponding Objective-C selector(s) for
that requirement, which means that the Swift and Objective-C semantics
will differ. Diagnose such issues.

More steps along the road to fixing rdar://problem/18383574.

Diagnose conflicts between unsatisfied, optional @objc requirements and

Swift SVN r24830
2015-01-29 22:53:46 +00:00
Doug Gregor
642da65ab1 Consider @objc selectors when matching witnesses to protocol requirements.
When we match a witness to a requirement in a protocol, we do so based
on the Swift name (which is correct). When the requirement is @objc
(because it is in an @objc protocol), also check that the Objective-C
selectors of the witness match those of the requirement.

Fixes the majority of rdar://problem/18383574.

Swift SVN r24829
2015-01-29 22:53:43 +00:00