Flow should allow a boolean to be appended/concatenated with a string just like currently is done with numbers. For example, this is ok in flow 0.73.0:
/* @flow */
function foo(s: string, x: number): string {
return s+x;
}
But this gives an error:
/* @flow */
function foo(s: string, x: boolean): string {
return s+x;
}
4: return s+x;
^ Cannot add `s` and `x` because boolean [1] is incompatible with string [2].
References:
3: function foo(s: string, x: boolean): string {
^ [1]
3: function foo(s: string, x: boolean): string {
^ [2]
I'd say the opposite thing: flow should not allow to concatenate strings with numbers.
The one that is annoying to me: number + boolean is allowed.
Most helpful comment
I'd say the opposite thing: flow should not allow to concatenate strings with numbers.