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
Hi! I borrowed your typing test suite for my library, banditypes — thanks for the excellent job!
I quickly discovered that test<Expected>() util checks that struct returns type assignable to Expected, not strictly equal to it. This might be dangerous, as a struct might check for a narrower type than expected:
test<string | number>((x) => {
assert(x, string())
return x
})
I suggest migrating the suite to expect-type or otherwise checking for strict equality. For reference, here's my MR with the change — it's not too hard.
The text was updated successfully, but these errors were encountered:
Hi! I borrowed your typing test suite for my library, banditypes — thanks for the excellent job!
I quickly discovered that
test<Expected>()
util checks that struct returns type assignable toExpected
, not strictly equal to it. This might be dangerous, as a struct might check for a narrower type than expected:I suggest migrating the suite to expect-type or otherwise checking for strict equality. For reference, here's my MR with the change — it's not too hard.
The text was updated successfully, but these errors were encountered: