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 res

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 1

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 +++: AdditionPrecedence > > func ***(x:

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 +++: AdditionPrecedence > > func ***(x: In

[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)

Re: [swift-users] Overload Resolution

2016-10-06 Thread Toni Suter via swift-users
Hi Mark, Thanks for pointing me into the right direction! Best regards, Toni > Am 06.10.2016 um 16:31 schrieb Mark Lacey : > > >> On Oct 6, 2016, at 4:53 AM, Toni Suter via swift-users >> mailto:swift-users@swift.org>> wrote: >> >> Hi, >> >> Does someone know a good explanation / summary of

Re: [swift-users] Overload Resolution

2016-10-06 Thread Mark Lacey via swift-users
> On Oct 6, 2016, at 7:31 AM, Mark Lacey wrote: > > >> On Oct 6, 2016, at 4:53 AM, Toni Suter via swift-users >> mailto:swift-users@swift.org>> wrote: >> >> Hi, >> >> Does someone know a good explanation / summary of Swift's overload >> resolution rules? >> After reading >> https://github.

Re: [swift-users] Overload Resolution

2016-10-06 Thread Mark Lacey via swift-users
> On Oct 6, 2016, at 4:53 AM, Toni Suter via swift-users > wrote: > > Hi, > > Does someone know a good explanation / summary of Swift's overload resolution > rules? > After reading https://github.com/apple/swift/blob/master/docs/TypeChecker.rst >

[swift-users] Overload Resolution

2016-10-06 Thread Toni Suter via swift-users
Hi, Does someone know a good explanation / summary of Swift's overload resolution rules? After reading https://github.com/apple/swift/blob/master/docs/TypeChecker.rst I understand that the overloading resolution happens as part of