type narrowing doesn’t work when using a non-type-literal field as a tag
Inside the test
function, b
type does not narrow to string
when a
type is string
.
Why? I don’t understand why it behaves this way.
Type narrowing on private members results in Property does not exist on type ‘never’ error
When I try to use type narrowing on a private member, I get a typescript error
Typescript: allow typeof check narrowing when comparing against a const
I want the following: