Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
schema: Avoid distribution of conditional type
Conditional types are distributed across all types of a union. This is not what we want in the case of Config. Distribution happens only over "naked" type parameters and so wrapping the type in a 1-tuple as well as the check type avoids this behavior. See: microsoft/TypeScript#29368 (comment) Before this change, the type of leaf nodes would resolve to: { Bluetooth: { Allowed: ( Gettable<'False'> & Settable<'False'> & Listenable<'False'> ) | ( Gettable<'True'> & Settable<'True'> & Listenable<'True'> ) } } whereas what we want is: { Bluetooth: { Allowed: ( Gettable<'False' | 'True'> & Settable<'False' | 'True'> & Listenable<'False' | 'True'> ) } }
- Loading branch information