*"if you add a `someFunc` overload taking a different parameter name but the same types the above code becomes ambiguous."*
Yes, I know, I forgot this example. Ironically that was the intent, but I do not choose good examples. I was just exploring the idea of having to display the full signature at some point. Em dom, 27 de dez de 2015 às 23:11, Michel Fortin <[email protected]> escreveu: > Le 27 déc. 2015 à 19:54, Wallacy via swift-evolution < > [email protected]> a écrit : > > Even with backticks would not be possible. > > > > You may need to reference the method signature altogether. > > > > var someA = A() > > let fn1 = someA.#someFunc(a: Int) -> Int > > let fn2 = someA.#someFunc(a: Int) -> Double > > let fn3 = someA.#someFunc(a: Double) -> Int > > let fn4 = someA.#someFunc(a: Double) -> Double > > > > An operator at the beginning perhaps? > > > > let fn1 = #someA.someFunc(a: Int) -> Int > > let fn2 = #someA.someFunc(a: Int) -> Double > > let fn3 = #someA.someFunc(a: Double) -> Int > > let fn4 = #someA.someFunc(a: Double) -> Double > > Well, this works today: > > let fn1: Int -> Int = someA.someFunc > let fn2: Int -> Double = someA.someFunc > let fn3: Double -> Int = someA.someFunc > let fn4: Double -> Double = someA.someFunc > > In fact, this too works: > > let fn1: (a: Int) -> Int = someA.someFunc > let fn2: (a: Int) -> Double = someA.someFunc > let fn3: (a: Double) -> Int = someA.someFunc > let fn4: (a: Double) -> Double = someA.someFunc > > See the parameter name in the type? It could be used to disambiguate, but > currently it is not taken into account: if you add a `someFunc` overload > taking a different parameter name but the same types the above code becomes > ambiguous. > > -- > Michel Fortin > https://michelf.ca > >
_______________________________________________ swift-evolution mailing list [email protected] https://lists.swift.org/mailman/listinfo/swift-evolution
