`Narrow` doesn't work properly on intersections with `{}` type
DetachHead opened this issue Β· comments
DetachHead commented
π Bug Report
Describe the bug
Reproduce the bug
declare const foo: <T>(value: Narrow<T>) => void
foo<1 & {}>(2 as 2 & {}) //no error
Expected behavior
error, because 2 & {}
is not assignable to 1 & {}
Possible Solution
Screenshots
Additional context
DetachHead commented
this is fixed in typescript 4.8 beta. so i'll close this assuming it was a typescript issue