|
|
|
|
|
by valenterry
1311 days ago
|
|
> Now, the error would be pushed to the `+` operator because there isn't an `Add` for `f32 | u32`. Why not? It makes total sense for one to exist. This is something the language needs to deal with, not the programmer. But the programmer always sprinkle annotations so that errors can only reach so far. |
|
I disagree: IME, when you add a float and an integer, you want to cast float to integer 50% of the time, and integer to float the remaining 50% of the time.
Even if it leads to more verbosity, I prefer arithmetic operations to be endomorphisms and use explicit casts.