[swift-evolution] Implicit Type Conversion For Numerics Where Possible.

Chris Lattner clattner at apple.com
Wed Mar 30 23:26:31 CDT 2016


> On Mar 30, 2016, at 4:10 PM, Jonathan Hull via swift-evolution <swift-evolution at swift.org> wrote:
> 
> Would a valid stop-gap be to define operators for some of the common cases?
> 
> For example:
> 
> func * (lhs:Double, rhs:Int)->Double
> 
> Are there issues with this approach that I am unaware of?  It seems like the desired cast (and the resulting effect) is obvious there, and you don’t get surprising casts elsewhere.

The major problem with this is type checker scalability.  It would drive it to be much more exponential than it is today, by completely exploding the overload sets for these operators.  

-Chris


More information about the swift-evolution mailing list