upvote
I gather it goes through an intermediate coercion step where it is "1" + "hello".

What trips us up is having existing expectations for what an operator called + should do.

reply
> Do you mean that if types had only to do with values, you would have to evaluate the term to determine type?

Exactly. And if that were the case, you couldn't do very much type checking at compile time.

Javascript, or more specifically Typescript, is precisely why I wrote "In most statically typed languages..."

In Typescript, you can write `1 + "hello"` and the type system will infer that the type of that term is 'string'. It doesn't change anything I wrote above.

reply