#Restraints on inferred types

5 messages · Page 1 of 1 (latest)

ornate cape
#

Can I do something like:

F extends (...args: infer Args) => infer R extends boolean | string

Or do I need to add another extends to check R afterwards?

halcyon lion
#

did you try it?

#

oh, it's not in the handbook, rip.

#

yes, you can do such things.

ornate cape