<FromGitter>
<azurelmao> adding T type restrictions in the method params didn't help
<FromGitter>
<azurelmao> sometimes it's such a pain having to cast everything to the desired type
<FromGitter>
<azurelmao> why can crystal do it automatically for literals but not for variables
<FromGitter>
<Blacksmoke16> prob because you're passing it `3.14` and not `3.14_f32`
<FromGitter>
<Blacksmoke16> ah right
<FromGitter>
<RespiteSage> I think that makes sense. You can't necessarily "fit" a Float64 into a Float32, so you'd need explicit conversion. If you want it to look like implicit conversion when creating the vector, you can put the conversion inside the constructors, but I'd just use Float32 wherever you're constructing the vector so your values don't change when they get turned into a vector.
<FromGitter>
<Blacksmoke16> ^ i agree
<FromGitter>
<Blacksmoke16> works for literals prob since the compiler can ensure it'll fit, versus a var which could be any size
<FromGitter>
<azurelmao> fair
<FromGitter>
<azurelmao> okay I can do .as(T) at least
<FromGitter>
<Blacksmoke16> thats prob not what you want. `.as` is generally for reducing the size of a union type, not converting a value from one type to anoterh
<FromGitter>
<Blacksmoke16> another*
<FromGitter>
<azurelmao> there is no .to_(T) is there?
<FromGitter>
<Blacksmoke16> `T.new` calls the related `to_*` method on the passed in value
<FromGitter>
<azurelmao> ooo, I'll try that
<FromGitter>
<Blacksmoke16> e.g. `Float32.new` => `to_f32`, `Int64.new` => `to_i64`
<FromGitter>
<Blacksmoke16> might want to add an assertion or something like `{% T.raise "Vec3 may only be used with numeric types" unless T <= Number %}` to prevent like `Vec3(String)`