ts-node
ts-node copied to clipboard
Wrong TS2345 error message in screenshot on website
Search Terms
TS2345 screenshot
Expected Behavior
error TS2345: Argument of type 'string' is not assignable to parameter of type 'number'.
Actual Behavior
The screenshot on website () shows
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)
~