Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong TS2345 error message in screenshot on website #2134

Open
muzimuzhi opened this issue Aug 17, 2024 · 0 comments
Open

Wrong TS2345 error message in screenshot on website #2134

muzimuzhi opened this issue Aug 17, 2024 · 0 comments

Comments

@muzimuzhi
Copy link

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)
         ~

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant