> On Jun 19, 2017, at 11:46 AM, Ted F.A. van Gaalen via swift-evolution
> <[email protected]> wrote:
>
> var result: Float = 0.0
> result = float * integer * uint8 + double
> // here, all operands should be implicitly promoted to Double before the
> complete expression evaluation.
You would have this produce different results than:
let temp = float * integer * uint8
result = temp + double
That would be extremely surprising to many unsuspecting users.
Don’t get me wrong; I *really want* implicit promotions (I proposed one scheme
for them way back when Swift was first unveiled publicly). But there’s a lot
more subtlety around them than it seems (for example the C and C++ implicit
promotion rules can easily be described on a half-sheet of paper, but are the
source of *innumerable* bugs). I would rather have no implicit promotions than
half-baked implicit promotions.
– Steve_______________________________________________
swift-evolution mailing list
[email protected]
https://lists.swift.org/mailman/listinfo/swift-evolution