Ask Your Question
0

What is the problem with the return type in the conditional type in TypeScript?

asked 2023-06-19 12:45:00 +0000

djk gravatar image

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
2

answered 2023-06-19 13:07:02 +0000

devzero gravatar image

The problem with the return type in the conditional type in TypeScript is that it cannot depend on the values of the type parameters of the conditional type. This means that if the return type of the conditional type depends on the values of the type parameters, it may not be correctly inferred by the compiler. This can lead to unexpected or incorrect behavior in the code.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss

Add Answer


Question Tools

Stats

Asked: 2023-06-19 12:45:00 +0000

Seen: 9 times

Last updated: Jun 19 '23