Files
swift-mirror/lib/Sema/CodeSynthesis.cpp
Doug Gregor 32aef82571 [Sema] Infer @objc and Objective-C name from conformance to a protocol.
When a particular method/initializer/property/subscript is used to
satisfied a requirement in an @objc protocol, infer both the presence
of @objc and the @objc name so that it matches the requirement. This
eliminates the need to explicitly specify @objc and @objc(foo:bar:) in
most cases. Note that we already did this for overrides, so it's a
generalization of that behavior.

Note that we keep this inference somewhat local, checking only those
protocols that the enclosing context conforms to, to limit
spooky-action-at-a-distance inference. It's possible that we could
lift this restriction later.

Fixes rdar://problem/24049773.
2016-04-28 22:04:18 -07:00

86 KiB