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-5435] Non-escaping closures from Objective-C break protocols #48009

Open
swift-ci opened this issue Jul 11, 2017 · 3 comments
Open

[SR-5435] Non-escaping closures from Objective-C break protocols #48009

swift-ci opened this issue Jul 11, 2017 · 3 comments
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself regression swift 4.0

Comments

@swift-ci
Copy link
Collaborator

Previous ID SR-5435
Radar rdar://problem/33238482
Original Reporter lightsprint09 (JIRA User)
Type Bug

Attachment: Download

Environment

Xcode 9 Beta 3 - Swift3.2 / 4

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

md5: df65fb8b4f5510627b2222eb4fcf6370

Issue Description:

Hi,

the following compiles in Xcode 9b2 Swift 3.2, but does not compile in b3.

import UIKit

protocol CollectionView {
    func performBatchUpdates(_ updates: (() -> Void)?, completion: ((Bool) -> Void)?)
    func performBatchUpdates(_ updates: (() -> Void)?, completion: ((Bool) -> Void)?)
}

extension UICollectionView: CollectionView {
   
}

struct DemoCollectionView {
    func performBatchUpdates(_ updates: (() -> Swift.Void)?, completion: ((Bool) -> Swift.Void)? = nil) {
        
    }
}

extension DemoCollectionView: CollectionView {}

let demoCollectionView = DemoCollectionView()

I am not sure if this is an issue with Swift or UIKit.

There was an API changes in UICollectionView for `performBatchUpdates` in Xcode9 (see)

@belkadan
Copy link
Contributor

@swift-ci create

@belkadan
Copy link
Contributor

I'm afraid we're not likely to have a fix for this in the Swift 4 timeframe. You can work around this by defining the protocol in Objective-C and using NS_NOESCAPE there.

@swift-ci
Copy link
Collaborator Author

Comment by Lukas Schmidt (JIRA)

Ok. I keep an eye on the issue.

@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 regression swift 4.0
Projects
None yet
Development

No branches or pull requests

3 participants