|
|
|
|
|
by goto11
928 days ago
|
|
But that would only help you if you assign the numeric literal directly to a variable. If you use it in an expression like `foo(10)` or `10 * bar` you would still not see the numeric type specified. So if you want the type to be always explicit, the type specifier should be coupled with the literal like `10[i32]` or similar, so you can write `foo(10[i32])`. |
|
Assigning variables or calling methods (when you discard the return value) would look the same as is typical in many languages:
Named variables in method calls would have to have the type so as to not hide what type a method-as-parameter returns: