3 ms·
I'm sure you can just use a linter or configure the compiler to error out in such a case if there are really no use-cases, no?
by valenterry 4y ago
I'm sure you can just use a linter or configure the compiler to error out in such a case if there are really no use-cases, no?
- hn92726819 4y agoWhat do you mean? It already errors out if you try adding them together because it requires explicit casts. What the comment you're replying to is saying is that it's better to just explicitly cast than figure out what the compiler guesses. let x=19/10+0.5 I want to decide for myself if my result is 2.4, 1.5, 1, or 2 in the example above
- valenterry 4y agoThe OP doesn't like that the error moves from the condition to the addition. And what I mean is that then just lint that there shouldn't be unions of number-types or so.