type-fest icon indicating copy to clipboard operation
type-fest copied to clipboard

`RequiredDeep` silently erases types past a depth of 3 as a side-effect

Open ahrjarrett opened this issue 11 months ago • 2 comments

See this issue, specifically this comment.

Using a recursively mapped type like RequiredDeep comes with a side effect: even though VS Code seems to resolve the type, the type-checker ignores anything past a depth of 3.

Note that it's quite difficult to identify that type-checking is not happening at all, since there's still no indication by looking at the types that they don't actually check anything.

Users are almost certainly unaware that by using recursively mapped types like RequiredDeep, they are effectively turning off the type checker.

Upvote & Fund

  • We're using Polar.sh so you can upvote and help fund this issue.
  • The funding will be given to active contributors.
  • Thank you in advance for helping prioritize & fund our backlog.
Fund with Polar

ahrjarrett avatar Sep 02 '23 15:09 ahrjarrett

https://tsplay.dev/wQbdvN

Tagging @ssalbdivad for visibility -- he's the one who thought to test this bug with RequiredDeep

ahrjarrett avatar Sep 02 '23 15:09 ahrjarrett

Looks like this will be fixed by https://github.com/microsoft/TypeScript/pull/55638 🤞

ahrjarrett avatar Sep 05 '23 16:09 ahrjarrett