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-8882] Swift's overlay of MTLCopyAllDevicesWithObserver shouldn't return an NSObject observer token #51388

Open
hamishknight opened this issue Sep 29, 2018 · 1 comment
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. SDKOverlay

Comments

@hamishknight
Copy link
Collaborator

Previous ID SR-8882
Radar rdar://problem/44909761
Original Reporter @hamishknight
Type Bug
Environment

Swift 4.2
macOS 10.14 SDK

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

md5: 930a99f52878686f430b9822b3b3c26c

Issue Description:

Currently Swift's Metal overlay for MTLCopyAllDevicesWithObserver has the following signature:

public func MTLCopyAllDevicesWithObserver(handler: @escaping MTLDeviceNotificationHandler) -> (devices:[MTLDevice], observer:NSObject)

The observer is returned as an NSObject. However, the underlying Obj-C API returns it as an id<NSObject>, which is imported into Swift as NSObjectProtocol. This mismatch means the overlay currently needs to force cast to NSObject.

Ideally we should change the Swift overlay such that it's returned as an NSObjectProtocol, or possibly even Any.

@belkadan
Copy link
Contributor

belkadan commented Oct 1, 2018

@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. SDKOverlay
Projects
None yet
Development

No branches or pull requests

2 participants