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

Chris Lattner clattner at apple.com
Wed Mar 30 17:12:36 CDT 2016


> On Mar 30, 2016, at 5:01 AM, Ted F.A. van Gaalen via swift-evolution <swift-evolution at swift.org> wrote:
> 
> Currently, one has to deal with explicit conversion between numerical types,
> which in many cases is unnecessary and costing time to code 
> for things that are quite obvious,
> and cluttering the source, making it less readable.

Yes, I would also like to get to a model where “smaller things” can implicitly promote to “larger things”, when there is no loss of data (and in the case of CGFloat, we can be more loose with precision IMO).

This is covered under the guise of being able to define a subtype relationship between structs, which is something that I and many other people would love to have, but it is outside the scope of Swift 3.

-Chris



More information about the swift-evolution mailing list