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

Can't extend WeakMap in type-checked JS files #23551

Closed
zombie opened this issue Apr 19, 2018 · 0 comments · May be fixed by #56713
Closed

Can't extend WeakMap in type-checked JS files #23551

zombie opened this issue Apr 19, 2018 · 0 comments · May be fixed by #56713
Assignees
Labels
Bug A bug in TypeScript Fix Available A PR has been opened for this issue Fixed A PR has been merged for this issue

Comments

@zombie
Copy link

zombie commented Apr 19, 2018

TypeScript Version: 2.8.1

Search Terms:
extend WeakMap, WeakSet, "Base constructors must all have the same return type."

Code

class ColorMap extends WeakMap {
  constructor(color) {
    super();
  }
}

Type-checked using:

tsc color.js -t es6 --checkJs --allowJs --noEmit

Actual behavior:

color.js(1,24): error TS2510: Base constructors must all have the same return type.

Notes:
It works with a Map or Set, or in a *.ts file.

@DanielRosenwasser DanielRosenwasser added Bug A bug in TypeScript Salsa labels Apr 19, 2018
@DanielRosenwasser DanielRosenwasser added this to the TypeScript 2.9 milestone Apr 19, 2018
@mhegazy mhegazy added the Fixed A PR has been merged for this issue label Jul 2, 2018
@typescript-bot typescript-bot added the Fix Available A PR has been opened for this issue label Dec 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug A bug in TypeScript Fix Available A PR has been opened for this issue Fixed A PR has been merged for this issue
Projects
None yet
5 participants