On 3/19/12 6:56 PM, Tim Chevalier wrote:
I don't think we have any plans to add implicit casts as implied by
your other 4 examples. It seems too complex -- if any of the variables
in your example were mutated after being initialized, the pass that
would insert these casts would get pretty complicated.

Actually, I don't think Chris was suggesting having a pass that computes the possible set of values for each local. I think he was getting at more of a "must-be-wider-than" relation among numeric types. For example, you know that every u8 value can be losslessly converted to an i16 based on the types alone.

Java has something similar.

Patrick
_______________________________________________
Rust-dev mailing list
[email protected]
https://mail.mozilla.org/listinfo/rust-dev

Reply via email to