SE-0307: Allow interchangeable use of CGFloat and Double types

-1 casting behavior in swift is already too complex for me, and this would add even more complexity.

for example the document explaining the behavior of dynamic casting (as? as! is) is 745 lines or 36.8 KB
and it doesn't even include description of implicit casts, or the as operator. This proposal would make it even more complicated, by adding even more exceptions to the rules.

I'm not the only person that feels like the current situation is too complex


To people in this thread that talk about the goal of eliminating CGFloat:

The idea that CGFloat would be eliminated is silly. CGFloat would remain here forever.

Take for example these two obj-c methods:

    [[NSString alloc] initWithString:foo];
    [NSString stringWithString:foo];

When ARC was introduced (a decade ago!) both of these method suddenly are completely interchangeable, just like CGFloat and Double will be after this proposal is accepted. Both of them are still here. Both of them are still supported. Neither is deprecated.

Today people want to eliminate CGFloat because the conversions bother everyone. After this proposal, nobody would care, and use them almost randomly.

5 Likes