Re: [swift-users] Overload Resolution of Binary Operators

2016-11-15 Thread Toni Suter via swift-users
@David If you would split up the statement like this... let x = 0 *** 4 let result = x +++ 0 ... the compiler would report an ambiguity error, because both overloads of *** are valid and of equivalent priority. You could do something like this though: let x: Int = 0 *** 4// picks f2 let

Re: [swift-users] Overload Resolution of Binary Operators

2016-11-14 Thread Rien via swift-users
I seem to remember that while it is possible to define, the compiler will yield an error if you try to use the functions (“cannot resolve”). Regards, Rien Site: http://balancingrock.nl Blog: http://swiftrien.blogspot.com Github: http://github.com/Swiftrien Project: http://swiftfire.nl > On

Re: [swift-users] Overload Resolution of Binary Operators

2016-11-14 Thread Mark Lacey via swift-users
> On Nov 14, 2016, at 2:05 PM, Toni Suter via swift-users > wrote: > > Hi, > > I would have expected that the following code reports an error, because > of ambiguous function overloads: > > infix operator ***: MultiplicationPrecedence > infix operator +++:

Re: [swift-users] Overload Resolution of Binary Operators

2016-11-14 Thread David Sweeris via swift-users
> On Nov 14, 2016, at 16:05, Toni Suter via swift-users > wrote: > > Hi, > > I would have expected that the following code reports an error, because > of ambiguous function overloads: > > infix operator ***: MultiplicationPrecedence > infix operator +++:

[swift-users] Overload Resolution of Binary Operators

2016-11-14 Thread Toni Suter via swift-users
Hi, I would have expected that the following code reports an error, because of ambiguous function overloads: infix operator ***: MultiplicationPrecedence infix operator +++: AdditionPrecedence func ***(x: Int, y: Int) -> String { print("f1") return "" } func ***(x: Int, y: Int)