|
|
|
|
|
by throwawaymaths
1324 days ago
|
|
Two options: 1. Don't type units like that. 2. Allow the * operator to multiply a time-unitful value with an untimed scalar and disallow using it with two time-unitful values. Presumably the requirement that * operands are the same is arbitrarily modifiable and go developers have control over what types operators take. |
|
2. A "time unit" is not a special type of value. You can construct arbitrary types of integers, and it is common to do so. `*` has no clue what a time is, just that it's "not an int" (for example).