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-1518] cannot implement tableView:cellForRowAtIndexPath: in Swift 3 #44127

Closed
mattneub opened this issue May 13, 2016 · 4 comments
Closed
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself

Comments

@mattneub
Copy link

Previous ID SR-1518
Radar None
Original Reporter @mattneub
Type Bug
Status Resolved
Resolution Duplicate
Environment

Toolchain: Swift Development Snapshot 2016-05-09 (a)

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

md5: 65f7da963cd303ca2873d0da6793798a

duplicates:

  • SR-1514 impossible to adopt WKScriptMessageHandler protocol

Issue Description:

This simple code doesn't compile:

class ViewController: UIViewController {
}

extension ViewController : UITableViewDataSource {
    func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
        return 0
    }
    
    func tableView(_ tableView: UITableView, cellForRowAt indexPath: NSIndexPath) -> UITableViewCell {
        return UITableViewCell()
    }
}

I cannot find any way to implement `tableView:cellForRowAtIndexPath:` that will satisfy the compiler.

Interestingly, UITableViewController doesn't have this difficulty, presumably because the way checking is done for an override is not the same as how checking is being done for a protocol requirement.

@mattneub
Copy link
Author

This is probably related to SR-1514.

This issue is serious enough that I've also filed a bug at the Apple bugreporter, http://rdar/problem/26281904

@belkadan
Copy link
Contributor

Consolidating; likely fixed in master.

@belkadan
Copy link
Contributor

(Also apologies for the coming reverse Radar dup. We already started tracking it under another bug, now linked from SR-1514.)

@mattneub
Copy link
Author

mattneub commented Jun 3, 2016

Confirmed that this is fixed in toolchain release of May 31.

@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

2 participants