Bug Report
🔎 Search Terms
assignability regression
🕗 Version & Regression Information
- This changed between versions 4.2 and 4.3-beta
⏯ Playground Link
Playground link with relevant code
💻 Code
export type UnrollOnHover<O extends object> = O extends object ?
{ [K in keyof O]: O[K]; } :
never;
export type Schema = Record<string, unknown>;
class Table<S extends Schema> {
__schema!: S;
// Removing this line, removes the error
getRows<C extends keyof S>(): Array<UnrollOnHover<Pick<S, C>>> {
return null!
}
}
class ColumnSelectViewImp<S extends Schema> extends Table<S> { }
const ColumnSelectView1: new <S extends Schema>() => Table<UnrollOnHover<S>> = ColumnSelectViewImp;
const ColumnSelectView2: new <S extends Schema>() => Table<UnrollOnHover<S>> = Table;
🙁 Actual behavior
Assignment to ColumnSelectView1 failed
🙂 Expected behavior
Assignment to ColumnSelectView1 succeeds as it did in 4.2
Workaround
Wrap S in UnrollOnHover as well Playground link
Bug Report
🔎 Search Terms
assignability regression
🕗 Version & Regression Information
⏯ Playground Link
Playground link with relevant code
💻 Code
🙁 Actual behavior
Assignment to
ColumnSelectView1failed🙂 Expected behavior
Assignment to
ColumnSelectView1succeeds as it did in 4.2Workaround
Wrap
SinUnrollOnHoveras well Playground link