We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
TypeScript Version: 3.0.0-dev.20180630
Search Terms: TS2510 "Base constructors must all have the same return type" allowJs
Code
/** * @extends {Set<number>} */ class MySet extends Set {} var x = new MySet(); for (const n of x) { console.log(n); }
tsc file.js --allowJs --checkJs --noEmit --lib es2017
Expected behavior:
It should compile fine and infer the type of n to number.
n
number
Actual behavior:
It errors with:
file.js:4:21 - error TS2510: Base constructors must all have the same return type. class MySet extends Set {}
but at least infers n to number.
Playground Link: Playground doesn't support allowJs
allowJs
Related Issues: #23551 similar error message, also allowJs, but not using @extends
@extends
The text was updated successfully, but these errors were encountered:
Consolidate overloads in constructors for Map, Set, WeakMap, and WeakSet
4dd1f9f
Fixes #23551 Fixes #25362
@sokra give typescript@next a try tomorrow and let us know if you are still running into issues.
typescript@next
Sorry, something went wrong.
Map
mhegazy
No branches or pull requests
TypeScript Version: 3.0.0-dev.20180630
Search Terms:
TS2510 "Base constructors must all have the same return type" allowJs
Code
tsc file.js --allowJs --checkJs --noEmit --lib es2017
Expected behavior:
It should compile fine and infer the type of
n
tonumber
.Actual behavior:
It errors with:
but at least infers
n
to number.Playground Link:
Playground doesn't support
allowJs
Related Issues:
#23551 similar error message, also allowJs, but not using
@extends
The text was updated successfully, but these errors were encountered: