Open
Description
openedon Dec 4, 2023
π Search Terms
WeakMap constructors return type JSDoc
π Version & Regression Information
- This is the behavior in every version I tried. I opened Can't extend WeakMap in type-checked JS filesΒ #23551 5 years ago, but it got closed in error, as it was never fixed.
β― Playground Link
π» Code
class ColorMap extends WeakMap {
constructor() {
super();
}
}
π Actual behavior
color.js(1,24): error TS2510: Base constructors must all have the same return type.
I tried a few different workarounds, like adding @template generic params, or forcing types using @type JSDoc, but nothing seems to work.
π Expected behavior
No error.
Additional information about the issue
No response
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment