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-545] Unable to use IOBluetooth framework with Xcode 7.2 and Swift 2.2 toolchain in clean project #43162

Closed
swift-ci opened this issue Jan 14, 2016 · 4 comments
Assignees
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-545
Radar None
Original Reporter mattrajca (JIRA User)
Type Bug
Status Resolved
Resolution Done

Attachment: Download

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

md5: a1482ba762fa12de03cb0bff167c49cc

Issue Description:

I am unable to declare a simple variable of type IOBluetoothDevice without getting a build error of "`IOBluetoothDevice` is ambiguous for type lookup in this context".

There are no other source files or frameworks included beyond what is shown in the snippet above.

This reproduces with a clean install of Xcode 7.2, the January 11 Swift 2.2 toolchain, and the project file attached here: http://cl.ly/0x37283k3G3j

This is a regression from Swift 2.1.

Steps to reproduce:

1. Install Xcode 7.2 from the Mac App Store
2. Download and install the Swift 2.2 toolchain from https://swift.org/download/
3. Run Xcode 7.2 with xcrun launch-with-toolchain /Library/Developer/Toolchains/swift-latest.xctoolchain
4. Try building the project.

@lplarson
Copy link
Member

Verified reproducible.

@belkadan
Copy link
Contributor

I'm not sure why the behavior changed, but we really do have two things called "IOBluetoothDevice": an Objective-C class, and an "IOBluetoothDeviceRef" CF type that gets mapped into Swift as "IOBluetoothDevice". (To add insult to injury, they are actually the same type.)

I'll look into just not importing IOBluetoothDeviceRef.

@belkadan
Copy link
Contributor

Fixed in 621edeb. I'll see about getting it into the 2.2 branch.

@belkadan
Copy link
Contributor

Cherry-picked to the 2.2 branch as 44be782.

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
This issue was closed.
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

3 participants