Preview:ts ... type Foo = MessageFieldsFromType<PrivateMessage>; // ^?
#Conditional type / inference returns never
10 messages · Page 1 of 1 (latest)
Why does this return never? From my understanding, it should clearly return PrivateMessageFields
I just noticed that it does work if I explicitly annotate PrivateMessage#paramSpec as MessageParamSpec<PrivateMessageFields>, but I don't really want to do that
I already write enough stuff twice as is
Got it - Record is really not my friend today
When I use mapped type syntax directly, it all works
am i missing something? it seems not work even all Records are replaced to mapped type syntax (in the playground that you posted)
Preview:```ts
export interface BaseMessageParamSpecEntry {
trailing?: boolean
}
export interface RequiredMessageParamSpecEntry
extends BaseMessageParamSpecEntry {
optional?: false
}
export interface OptionalMessageParamSpecEntry
extends BaseMessageParamSpecEntr
...```
You can choose specific lines to embed by selecting them before copying the link.