After digging in the codebase I found the issue and it's a broken check:
// lib/types/parse-schema/references/utils.d.ts
P extends string ? <do-a-thing> : <do-another>
But P can be undefined and undefined extends string returns true
If we revert the check, so string extends undefined than it works because string doesn't extend undefined
Simple refs are not working due to a broken TS check. Here's a reproducible example:
This returns:
After digging in the codebase I found the issue and it's a broken check:
But
P
can be undefined andundefined extends string
returns true If we revert the check, sostring extends undefined
than it works becausestring
doesn't extendundefined