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

Required parameters are not checked in JS files #22080

Closed
que-etc opened this issue Feb 21, 2018 · 3 comments
Closed

Required parameters are not checked in JS files #22080

que-etc opened this issue Feb 21, 2018 · 3 comments
Assignees
Labels
Bug A bug in TypeScript Fixed A PR has been merged for this issue

Comments

@que-etc
Copy link

que-etc commented Feb 21, 2018

TypeScript Version: 2.8.0-dev.20180220

Search Terms:

  • jsdoc
  • checkJs
  • function type
  • arguments

Code

/** @type {function(string): void} */
const func = (value) => {
    // ...
}

// Following line should raise an error as 'func' invocation
// is missing required parameter, but it doesn't happen.
func();

Expected behavior:
An error Expected 1 argument, but got 0. should be thrown.

Actual behavior:
No error is thrown. TypeScript allows to invoke former function without passing arguments to it.

@ghost
Copy link

ghost commented Feb 21, 2018

Probably due to #13905. @mhegazy

@mhegazy
Copy link
Contributor

mhegazy commented Feb 21, 2018

I think it is rather due to #13905

@sandersn
Copy link
Member

Fix is up at #22692

@mhegazy mhegazy added the Fixed A PR has been merged for this issue label Mar 28, 2018
@microsoft microsoft locked and limited conversation to collaborators Jul 25, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bug A bug in TypeScript Fixed A PR has been merged for this issue
Projects
None yet
Development

No branches or pull requests

3 participants