Skip to content

[SR-9030] yet another misplaced "ambiguous reference" error message #51533

@mattneub

Description

@mattneub
Previous ID SR-9030
Radar None
Original Reporter @mattneub
Type Improvement
Additional Detail from JIRA
Votes 0
Component/s Compiler
Labels Improvement, DiagnosticsQoI
Assignee None
Priority Medium

md5: 7e8e1a5e1380eef1796eec2be27b68a0

Issue Description:

class C : NSObject, UITableViewDataSource {
    func tableView(_ tableView: UITableView, 
        numberOfRowsInSection section: Int) -> Int {
            return 1
    }
    func tableView(_ tableView: UITableView, 
        cellForRowAt indexPath: IndexPath) -> UITableViewCell {
            return UITableViewCell()
    }
    func test() {
        _ = self.tableView.indexPathForSelectedRow
        // error: ambiguous reference 
        // to member 'tableView(_:numberOfRowsInSection:)'
    }
}

There's no ambiguous reference to anything. The problem, quite unambiguously, is that `self.tableView` is not a thing.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions