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
typeMyObject={readonlykind:{kind:"a";};readonlya:string;}|{readonlykind:{kind:"b";};}constcreate=():MyObject=>({a:"",kind:{kind:"a"}});constmedia=create();media.kind.kind==="a"&&media.a;// Property 'a' does not exist on type 'MyObject'.
π Actual behavior
Compiler throws error on the last
Property 'a' does not exist on type 'MyObject'.
Property 'a' does not exist on type '{ readonly kind: { kind: "b"; }; }'.
π Expected behavior
By type definition, compiler has enough information to resolve that property a does exist on my object b/c there is no other option for media.kind.kind === "a"
The text was updated successfully, but these errors were encountered:
Bug Report
π Search Terms
infer, kind, nested
π Version & Regression Information
β― Playground Link
Playground link with relevant code
π» Code
π Actual behavior
Compiler throws error on the last
π Expected behavior
By type definition, compiler has enough information to resolve that property
a
does exist on my object b/c there is no other option formedia.kind.kind === "a"
The text was updated successfully, but these errors were encountered: