Navigation Menu

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

[SR-14079] Error on import of xcframework #56468

Open
swift-ci opened this issue Jan 21, 2021 · 1 comment
Open

[SR-14079] Error on import of xcframework #56468

swift-ci opened this issue Jan 21, 2021 · 1 comment
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself

Comments

@swift-ci
Copy link
Collaborator

Previous ID SR-14079
Radar rdar://problem/73460932
Original Reporter komakai (JIRA User)
Type Bug
Environment

XCode 12.3

macOS 10.15.7

MacBook Pro (2018)

Additional Detail from JIRA
Votes 0
Component/s Compiler
Labels Bug
Assignee None
Priority Medium

md5: 9be91d998919de177fea1b2cf76fd841

Issue Description:

Hello this bug report relates to an issue we are having over at OpenCV: opencv/opencv#19254

We have normal iOS and macOS frameworks which are working just fine - however when we combine them into an xcframework and then try and import that xcframework the Swift compiler gives an error on the import.

I have created a repository on Github here: https://github.com/opencv/opencv/issues/19254 which isolates the conditions under which the error occurs.

The conditions are:

  1. Combined Objective-C/Swift framework

  2. An Objective-C class with a NS_SWIFT_NAME declaration that renames the class in Swift with a name that matches the name of an object in Darwin

  3. A Swift class that uses import and uses Foundation framework

  4. A Swift declaration that uses the Swift name of the class in 2

An example of the errors returned is:

/xxx/ViewController.swift:9:8: error: failed to build module 'XcFrameTest' from its module interface; it may have been damaged or it may have triggered a bug in the Swift compiler when it was produced
import XcFrameTest
       ^
/xxx/Xcode/DerivedData/TestXcFrame-cjcpvodfchxqayegspcbiajyodzr/Build/Products/Debug-iphoneos/XcFrameTest.framework/Modules/XcFrameTest.swiftmodule/arm64-apple-ios.swiftinterface:8:40: error: ambiguous type name 'Size' in module 'XcFrameTest'
  public func area(_ size: XcFrameTest.Size) -> Swift.Int32
                           ~~~~~~~~~~~ ^
XcFrameTest.Size:1:12: note: found candidate with type 'Size'
open class Size : NSObject {
           ^
Darwin.Size:1:18: note: found candidate with type 'Size' (aka 'Int')
public typealias Size = Int
@typesanitizer
Copy link

@swift-ci create

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself
Projects
None yet
Development

No branches or pull requests

2 participants