Closed as not planned
Description
π Search Terms
jsdoc union type narrow
π Version & Regression Information
v5.8.2
β― Playground Link
π» Code
π Actual behavior
Property 'error' does not exist on type 'ApiJsonResponse<string>'.
Property 'error' does not exist on type 'ApiJsonData<string>'.
π Expected behavior
No error, and for the type to be narrowed correctly.
Additional information about the issue
In my actual code, I have the types (same as in the typescript playground link), in a d.ts
file. I simply converted them to jsdoc comments for the playground.
It does correctly narrow, if I change it to if( data.success === false )