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
exportconstdata={fails: castType({// NOTE: It fails if this function has an argumentsubscribe: (_foo)=>({foo: "bar"}asconst),resolve: (data)=>data.foo,}),works: castType({// NOTE: It works if argument is not definedsubscribe: ()=>({foo: "bar"}asconst),resolve: (data)=>data.foo,}),};exportfunctioncastType<TPayload>(resolver: {subscribe: (foo: boolean)=>TPayload;resolve?: (parent: TPayload)=>any;}){returnresolver;}
🙁 Actual behavior
It fails to determine the correct type in a generic if an argument is specified.
🙂 Expected behavior
It should determine the correct types for a generic.
The text was updated successfully, but these errors were encountered:
Bug Report
I am sorry for a dry bug report, I am not sure why it happens and what area of TS this is concerned but I have a repro in hopes this would be fixed.
🔎 Search Terms
No idea, really.
🕗 Version & Regression Information
⏯ Playground Link
Playground link with relevant code
💻 Code
🙁 Actual behavior
It fails to determine the correct type in a generic if an argument is specified.
🙂 Expected behavior
It should determine the correct types for a generic.
The text was updated successfully, but these errors were encountered: