Skip to content

Function call gives bogus error about type arguments when real problem is a missing argument #25683

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

Closed
mattmccutchen opened this issue Jul 16, 2018 · 1 comment
Assignees
Labels
Bug A bug in TypeScript Domain: Error Messages The issue relates to error messaging Fixed A PR has been merged for this issue

Comments

@mattmccutchen
Copy link
Contributor

TypeScript Version: master (60986ad)

Search Terms: "expected" "type arguments but got"

Code

function f<A, B = {}>(arg: number) {}
f<number>();

Expected behavior: Error: Expected 1 arguments, but got 0.

Actual behavior: Error: Expected 1-2 type arguments, but got 1.

Playground Link: link

Related Issues: #19374

@mattmccutchen
Copy link
Contributor Author

Easy fix up at #25733.

@mhegazy mhegazy added the Fixed A PR has been merged for this issue label Jul 17, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug A bug in TypeScript Domain: Error Messages The issue relates to error messaging Fixed A PR has been merged for this issue
Projects
None yet
Development

No branches or pull requests

4 participants