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

Treat empty curly generic defaults in an extends clause in a .js file as any #19971

Closed
mhegazy opened this issue Nov 13, 2017 · 0 comments
Closed
Assignees
Labels
Bug A bug in TypeScript Fixed A PR has been merged for this issue

Comments

@mhegazy
Copy link
Contributor

mhegazy commented Nov 13, 2017

When instantiating a generic base type in an extends clause, we allow generic type references to miss type parameters. for that we use the defaults if available (see #14907) then fill them with any.

React components now have generic defaults for props and state to be {}. this breaks the JS experience making all React components in a js file property-less. we should fall on the permissive side in a .js file, and special case {} to be treated as any.

Reported originally in #14558

@mhegazy mhegazy added Bug A bug in TypeScript Salsa labels Nov 13, 2017
@mhegazy mhegazy added this to the TypeScript 2.7 milestone Nov 13, 2017
@weswigham weswigham changed the title Treat generic defaults in an extends clause in a .js file as any Treat empty curly generic defaults in an extends clause in a .js file as any Nov 13, 2017
@mhegazy mhegazy added the Fixed A PR has been merged for this issue label Nov 13, 2017
@microsoft microsoft locked and limited conversation to collaborators Jun 14, 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

2 participants