You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Line 2 throws an Argument of type '"bar"' is not assignable to parameter of type '"foo"' error.
However, set.has(...) is meant to detect whether an element is in the set, therefore by definition it should be able to accept arguments that are not in the set---in which case, it just returns false.
Suggestion
Currently if you do
Line 2 throws an
Argument of type '"bar"' is not assignable to parameter of type '"foo"'
error.However,
set.has(...)
is meant to detect whether an element is in the set, therefore by definition it should be able to accept arguments that are not in the set---in which case, it just returnsfalse
.It seems the fix is simply replace
TypeScript/lib/lib.es2015.collection.d.ts
Line 63 in 69cc9ba
🔍 Search Terms
set, has, dom, lib, any, type, const
✅ Viability Checklist
My suggestion meets these guidelines:
⭐ Suggestion
Allow
set.has(...)
to accept any arguments that are not in the set.📃 Motivating Example
N/A
💻 Use Cases
N/A
The text was updated successfully, but these errors were encountered: