Skip to content

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

Closed

Description

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

Activity

  1. 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`[/+] on Nov 13, 2017
  2. locked and limited conversation to collaborators on Jun 14, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

BugA bug in TypeScriptFixedA PR has been merged for this issue

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions