Skip to content
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

Ambiguous use of XCTFail #747

Closed
lukeredpath opened this issue Aug 25, 2021 · 1 comment · Fixed by #749
Closed

Ambiguous use of XCTFail #747

lukeredpath opened this issue Aug 25, 2021 · 1 comment · Fixed by #749

Comments

@lukeredpath
Copy link
Contributor

Describe the bug
575d7c0 added XCTestDynamicOverlay as an @_exported import meaning its symbols are imported wherever you import TCA.

As a result, if you now import ComposableArchitecture and XCTest in the same file, you will get a compile error: Ambiguous use of 'XCTFail(_:file:line:)'

To Reproduce
Create a test file in a test target and import both TCA and XCTest.

Its not possible to explicitly reference the XCTest version using XCTest.XCTFail so you need to instead reference XCTestDynamicOverlay.XCTFail which is probably not desirable when you know XCTest is available.

Expected behavior
TCA should not export the XCTestDynamicOverlay symbols - if you want to use XCTestDynamicOverlay in your own library or helper code you should import it explicitly.

Environment

  • swift-composable-architecture version: 0.25.1
  • Xcode 12.5

Additional context
Originally opened as a bug here: pointfreeco/swift-issue-reporting#12

@lukeredpath
Copy link
Contributor Author

Thank you for the super-fast turnaround on this :)

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 a pull request may close this issue.

1 participant