> On Jun 17, 2017, at 8:43 PM, Xiaodi Wu via swift-evolution 
> <[email protected]> wrote:
> 
> 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.


To be slightly less coy: You need to be able to say that one value type is a 
subtype of another. Then you can say Int8 is a subtype of Int16, and the 
compiler knows that it can convert any Int8 to an Int16 but not vice versa. 
This adds lots of complexity and makes parts of the compiler that are currently 
far too slow even slower, but it's not difficult to imagine, just difficult to 
practically implement given the current state of the Swift compiler.

-- 
Brent Royal-Gordon
Architechies

_______________________________________________
swift-evolution mailing list
[email protected]
https://lists.swift.org/mailman/listinfo/swift-evolution

Reply via email to