modularml / mojo

The Mojo Programming Language
https://docs.modular.com/mojo
Other
22.11k stars 2.54k forks source link

[mojo-stdlib] Implicit conversions between SIMD values can lose data #3149

Open lattner opened 1 week ago

lattner commented 1 week ago

Bug description

Santiago (@svpino) points out on twitter that Mojo accepts code like this: var b : Int64 = 1.67 even though we don't like implicit conversions that lose data.

I assume this is because we haven't adopted conditional conformances for the right initializers, is this possible to do now?

msaelices commented 1 week ago

Could I work on this?