Skip to content

Type checking doesn't work with extra function arguments #29409

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

Open
falsandtru opened this issue Jan 14, 2019 · 0 comments
Open

Type checking doesn't work with extra function arguments #29409

falsandtru opened this issue Jan 14, 2019 · 0 comments
Labels
Bug A bug in TypeScript
Milestone

Comments

@falsandtru
Copy link
Contributor

Extra argument types are inferred correctly but aren't checked. Looks like #17559 is implemented incompletely. And this code also breaks colorization by vscode like the following code.

function f(): <T extends string>(a: T) => void {
  return (a, b = a) => {
    isFinite(a);
    isFinite(b);
  }
}

cc @DanielRosenwasser @RyanCavanaugh

TypeScript Version: master

Search Terms:

Code

const f: () => void = (a = '') => isFinite(a); // should be error

Expected behavior:

Actual behavior:

Playground Link:

Related Issues:

@weswigham weswigham added the Bug A bug in TypeScript label Jan 14, 2019
@RyanCavanaugh RyanCavanaugh added this to the Backlog milestone Mar 14, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug A bug in TypeScript
Projects
None yet
Development

No branches or pull requests

3 participants