In Swift, all types and all operators are implemented in the standard library. How do you express the idea that, when you add values of disparate types T and U, the result should be of the type with greater precision? You need to be able to spell this somehow.
On Sat, Jun 17, 2017 at 22:39 David Sweeris <[email protected]> wrote: > > On Jun 17, 2017, at 16:16, Xiaodi Wu via swift-evolution < > [email protected]> wrote: > > On Sat, Jun 17, 2017 at 3:21 PM, Ted F.A. van Gaalen < > [email protected]> wrote: > > > As you know, Swift currently does not facilitate implicit conversion >> (coercion), >> which implies that current code (which of course does not contain >> implicit conversions) >> will function exactly as it does now, >> > > That is not implied. Swift has type inference, which means that, with the > implementation of implicit promotion, the inferred type of certain > expressions that are legal today will change. For instance, integer > literals have no type of their own and are inferred to be of some type or > another based on context. When combined with bitwise operators, the > presence or absence of overloads that allow heterogeneous operations can > change the result of code that compiles both before and after the > implementation of the feature. This is just one example of why implicit > integer promotion in a strictly typed language with type inference and > without certain generics features is very hard. > > > I'm not sure which generic features you're referring to. Would you (or > anyone else who knows) mind elaborating? > > - Dave Sweeris >
_______________________________________________ swift-evolution mailing list [email protected] https://lists.swift.org/mailman/listinfo/swift-evolution
