immutable-js-oss/immutable-js

Type Checking is broken for primitives

Closed this issue · 1 comments

From @rohitpratapitm on Mon, 10 Feb 2020 17:07:22 GMT

Set<string> is allowing users to pass Set<number>.

// passing NUMBERS in a set of STRING
set: Set<string> = Set<string>([1,2,3]);
Type checking should be enforced while using generics.

How to reproduce

See stackblitz here :
angular-immutable-js-generics-issue

Fixed in immutable@4.0.0-rc.12.