Skip to content

Conversation

jrose-apple
Copy link
Contributor

  • Explanation: The IBAction and IBOutlet attributes are used to identify members made available to Interface Builder. The compiler does some basic sanity checking on the types of these members to keep people from making obvious mistakes; unfortunately those checks were never updated for id-as-Any (SE-0116). This is mostly okay (you can still use AnyObject), but not when the method you want to mark as an action is also an override.
  • Scope: Pure-additive change that prevents an error from being emitted when a type is Any or Any?. Uses existing code paths for everything else.
  • Issue: rdar://problem/27853737
  • Reviewed by: @jckarter
  • Risk: Very low.
  • Testing: Added new compiler regression tests.

Before merging this pull request to apple/swift repository:

  • Test pull request on Swift continuous integration.

Triggering Swift CI

The swift-ci is triggered by writing a comment on this PR addressed to the GitHub user @swift-ci. Different tests will run depending on the specific comment that you use. The currently available comments are:

Smoke Testing

Platform Comment
All supported platforms @swift-ci Please smoke test
All supported platforms @swift-ci Please smoke test and merge
OS X platform @swift-ci Please smoke test OS X platform
Linux platform @swift-ci Please smoke test Linux platform

A smoke test on macOS does the following:

  1. Builds the compiler incrementally.
  2. Builds the standard library only for macOS. Simulator standard libraries and
    device standard libraries are not built.
  3. lldb is not built.
  4. The test and validation-test targets are run only for macOS. The optimized
    version of these tests are not run.

A smoke test on Linux does the following:

  1. Builds the compiler incrementally.
  2. Builds the standard library incrementally.
  3. lldb is built incrementally.
  4. The swift test and validation-test targets are run. The optimized version of these
    tests are not run.
  5. lldb is tested.

Validation Testing

Platform Comment
All supported platforms @swift-ci Please test
All supported platforms @swift-ci Please test and merge
OS X platform @swift-ci Please test OS X platform
OS X platform @swift-ci Please benchmark
Linux platform @swift-ci Please test Linux platform

Lint Testing

Language Comment
Python @swift-ci Please Python lint

Note: Only members of the Apple organization can trigger swift-ci.

…g#4320)

With id-as-Any, /existing/ IBAction methods that have unconstrained
sender parameters are being imported as taking 'Any?', and those
methods then can't be overridden in Swift.

We still don't allow arbitrary bridgeable types for IBActions and
IBOutlets. This makes enough sense for value types, but might get us
into trouble with swift_newtype at some point.

rdar://problem/27853737
(cherry picked from commit ed01f89)
@jrose-apple jrose-apple added this to the Swift 3.0 milestone Aug 16, 2016
@jrose-apple
Copy link
Contributor Author

@swift-ci Please test OS X platform

@tkremenek
Copy link
Member

@swift-ci test macOS

@tkremenek tkremenek merged commit 251e595 into swiftlang:swift-3.0-branch Aug 17, 2016
@jrose-apple jrose-apple deleted the swift-3-IBAction-as-Any branch August 17, 2016 15:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants