Default value with the same method signature in protocol

There have been discussions about new features that can help resolve this issue. Maybe you can revive this thread on evolution. Basically, if you could use a different name when implementing a protocol, the issue would not come up:

protocol A {
    func something()
}
class Test {
    func something(value: Bool = true) {
        print("method")
    }
}
extension Test: A {
    func somethingOfA() as A.something  { // Not valid syntax now
        print("protocol")
    }
}

let test = Test()
let a: A = Test()
test.something()   // method
test.somethingOfA() // protocol
(test as A).something()   // protocol
a.something() // protocol
3 Likes