'Cannot call value of non-function type' issue

Hi,


I have an issue calling a member function of a table view controller. I've reproduce the problem with the following dummy view controller:


import UIKit
class SimpleTableViewController: UITableViewController {
    /
    override func numberOfSectionsInTableView(tableView: UITableView) -> Int {
        /
        return 2
    }
    override func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
        /
        return 1
    }
    override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
        return tableView(tableView, cellForFooAtIndexPath: indexPath)
    }
  
    func tableView(tableView: UITableView, cellForFooAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
        let cell = tableView.dequeueReusableCellWithIdentifier("reuseIdentifier", forIndexPath: indexPath)
        /
        return cell
    }
}


The compiler complains on line 13 with the following error "Cannot call value of non-function type" ?!!!

If I prefix the call with 'self.', everything compiles without errors. Sounds like a bug to me or is there some rules I've missed or calling member functions in Swift 2.1 (I must admit I haven't re-read the latest Swift iBook) ?


Note, I use xcode 7.1.1 (7B1005) and compiled with the default settings for a new single view iOS project.

Other than prefixing `self.`, this compiles:

    override func tableView(tv: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
        return tableView(tv, cellForFooAtIndexPath: indexPath)
    }


The identifier `tableView` is being ambiguous with function parameter and method. Even if it is apparently clear for human readers, language parsers cannot easily resolve it.


`self.` is needed in some other cases, for example:

class AClass {
    var name: String
    init(name:  String) {
        self.name = name
    }
}

So, I wonder if Swift team would treat this issue as a bug and fix it.

'Cannot call value of non-function type' issue
 
 
Q