When looking at the following code snippet
type stringUndefined = "string" | undefined;
type What<T> = T extends undefined ? "true" : "false";
const no : What<stringUndefined> = "";
The value of 'no' ends up being
"true" | "false"
, rather than just "true"
as anticipated.
You can try running this code in TS-Playground
https://i.sstatic.net/kWgQS.png
Edit:
It is important to note that strict null checks are enabled