-
Notifications
You must be signed in to change notification settings - Fork 12.8k
WeakSet<T> should be WeakSet<T extends object> #14840
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
Comments
I did it, but @mhegazy reverted that fix in #15278. His reverting doesn't comply with the spec of ecma. We should comply with the spec. @mhegazy says |
We reverted the change to avoid breaking The definition in lodash is at the end of the file, not visible on github view: // Backward compatibility with --target es5
declare global {
interface Set<T> { }
interface Map<K, V> { }
interface WeakSet<T> { } // this breaks if lib.es6.d.ts has WeakSet<T extends object>
interface WeakMap<K extends object, V> { }
} |
Now that problem seems to have gone away. |
so what happened to lodash use of this API? |
A last fix is DefinitelyTyped/DefinitelyTyped#21502 and #19756. We need to accept some breaking changes, or never fix this bug. |
As i mentioned earlier, we need to first:
|
Is there a proposal issue of that? |
nope. |
Can you make it to resolve this issue? |
feel free to file a new issue for it. |
Why you don't do it? |
here you go #20018 |
Thanks. |
TypeScript Version: nightly (2.3.0-dev.20170324)
Code
Expected behavior:
An error, since this will fail at runtime.
Actual behavior:
No error.
The text was updated successfully, but these errors were encountered: