mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
When an optional requirement of an @objc protocol has a selector that collides with an entity that has a different *Swift* name but produces an Objective-C method with the same selector, we have an existing diagnostic complaining about the conflict. In such cases, make a few suggestions (with Fix-Its) to improve the experience: * Change Swift name to match the requirement, adding or modifying the @objc as appropriate. * Add "@nonobjc" to silence the diagnostic, explicitly opting out of matching an @objc requirement. This is intended to help with migration of Swift 2 code into Swift 3. The Swift 2 code will produce selectors that match Objective-C methods in the protocol from Swift names that don't match; this helps fix up those Swift names so that we now match. Fixes the rest of rdar://problem/25159872. In some sense, it's a stop-gap for more detailed checking of near-misses for optional requirements, but it's not clear how wide-reaching such changes would be.
35 KiB
35 KiB