Skip to content

[Interop] [SwiftToCxx] New Throw Error Test #59217

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 1 commit into from
Jun 3, 2022

Conversation

Robertorosmaninho
Copy link
Contributor

@Robertorosmaninho Robertorosmaninho commented Jun 2, 2022

This PR aims to introduce the known issue of Swift functions that thrown don't be translated as such when creating the bridge header file.

Given this simple function:

public func emptyThrowFunction() throws { print("passEmptyThrowFunction") }

The Expected Signature of emptyThrowFunction():

SWIFT_EXTERN void $s9Functions18emptyThrowFunctionyyKF(void) SWIFT_CALL; // emptyThrowFunction()
...
inline void emptyThrowFunction() {
    return _impl::$s9Functions18emptyThrowFunctionyyKF();
 }

The Current Signature of emptyThrowFunction():

SWIFT_EXTERN void $s9Functions18emptyThrowFunctionyyKF(void) SWIFT_NOEXCEPT SWIFT_CALL; // emptyThrowFunction()
...
inline void emptyThrowFunction() noexcept {
  return _impl::$s9Functions18emptyThrowFunctionyyKF();
}

This test is marked as XFAIL: * since it will fail in any context due to the hardcoded attributes SWIFT_NOEXCEPT and noexcept on the Swift Compiler.

@Robertorosmaninho
Copy link
Contributor Author

Hey @hyp, could you, please, review this PR?

@Robertorosmaninho Robertorosmaninho changed the title New SwiftToCxx Interop Error Test [Interop] [SwiftToCxx] New Throw Error Test Jun 2, 2022
@hyp hyp added the c++ interop Feature: Interoperability with C++ label Jun 2, 2022
@hyp hyp self-requested a review June 2, 2022 19:02
@hyp
Copy link
Contributor

hyp commented Jun 2, 2022

@swift-ci please test

@hyp hyp merged commit 0591246 into swiftlang:main Jun 3, 2022
@Robertorosmaninho Robertorosmaninho deleted the interop/SwiftToCXXErrorTest branch June 3, 2022 23:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c++ interop Feature: Interoperability with C++
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants