You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Wrong TS2345 error message in screenshot on website #2134
error TS2345: Argument of type '"foo"' is not assignable to parameter of type 'number'.
in which the value "foo" is used as type.
Minimal reproduction
$ npx ts-node
> const x = 10
undefined
> const y = 'foo'
undefined
> function add(x: number, y: number) { return x + y }
undefined
> add(x, y)
<repl>.ts:7:8 - error TS2345: Argument of type 'string' is not assignable to parameter of type 'number'.
7 add(x, y)
~
Activity