Skip to content

[5.1] [Typechecker] Allow bridging of Unmanaged to Objective-C for throwing functions #24331

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
May 1, 2019

Conversation

theblixguy
Copy link
Collaborator

Cherry-pick of #24135


Previously, we would emit an error diagnostic if a throwing @objc function returned Unmanaged<T>. This is now allowed when T is representable in Objective-C.

For example:

class Foo {}

@objc protocol Bar {
  func throwingMethod1() throws -> Unmanaged<CFArray> // ok
  func throwingMethod2() throws -> Unmanaged<Foo> // error
}

Resolves SR-9035.

[Typechecker] Allow bridging of Unmanaged to Objective-C for throwing functions
@theblixguy
Copy link
Collaborator Author

cc @jrose-apple

@jrose-apple jrose-apple requested a review from a team April 27, 2019 02:45
@jrose-apple
Copy link
Contributor

@swift-ci Please test

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - 277bb0f

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - 277bb0f

@jrose-apple
Copy link
Contributor

:-( Looks like the IR looked different in 5.1. You'll have to update the test.

@jrose-apple jrose-apple self-assigned this Apr 27, 2019
@theblixguy
Copy link
Collaborator Author

Ah, I didn't expect the IR to be slightly different. No worries, I have updated the test. Could you invoke the CI again? Thanks!

@jrose-apple
Copy link
Contributor

@swift-ci Please test

@jrose-apple jrose-apple merged commit 7e6c455 into swiftlang:swift-5.1-branch May 1, 2019
@jrose-apple
Copy link
Contributor

Thanks, @theblixguy!

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.

4 participants