🔎 Search Terms
Type alias circularly references itself (5.4 regression)
🕗 Version & Regression Information
- This changed between versions 5.3.3 and 5.4.5
⏯ Playground Link
https://www.typescriptlang.org/play?ts=5.4.5#code/C4TwDgpgBAQg9nANhAhgOwAouACwM4A8AKgHxQC8UewATgJZoDmUAZALABQUUA3p99wDaAaSgMoAawgg4AMyhEAugC4FIxVAgAPYBDQATPFABGCZOn4DuAfijDLV1UXWadew1DjGAVhADGwA4CtqLaugZGaACuALbGEDRQAD5UtAyMQVa2AAYAJDzCAL4AdPnwSKiY2PjE6iSF2ZkCqmgQAG4JTS3tCQDcloWCUjLySv0c-EA
💻 Code
type BooleanPaths<T> = string &
{
[K in keyof T]: T[K] extends boolean
? K
: T[K] extends object
? K extends number | string
? `${K}.${BooleanPaths<T[K]>}`
: never
: never;
}[keyof T];
🙁 Actual behavior
This code fails with two errors:
Type alias 'BooleanPaths' circularly references itself.
Type 'BooleanPaths' is not generic.
🙂 Expected behavior
The compilation should pass, as it has in previous versions.
Additional information about the issue
No response
🔎 Search Terms
Type alias circularly references itself (5.4 regression)
🕗 Version & Regression Information
⏯ Playground Link
https://www.typescriptlang.org/play?ts=5.4.5#code/C4TwDgpgBAQg9nANhAhgOwAouACwM4A8AKgHxQC8UewATgJZoDmUAZALABQUUA3p99wDaAaSgMoAawgg4AMyhEAugC4FIxVAgAPYBDQATPFABGCZOn4DuAfijDLV1UXWadew1DjGAVhADGwA4CtqLaugZGaACuALbGEDRQAD5UtAyMQVa2AAYAJDzCAL4AdPnwSKiY2PjE6iSF2ZkCqmgQAG4JTS3tCQDcloWCUjLySv0c-EA
💻 Code
🙁 Actual behavior
This code fails with two errors:
Type alias 'BooleanPaths' circularly references itself.
Type 'BooleanPaths' is not generic.
🙂 Expected behavior
The compilation should pass, as it has in previous versions.
Additional information about the issue
No response