-
Notifications
You must be signed in to change notification settings - Fork 13.2k
Closed
Labels
BugA bug in TypeScriptA bug in TypeScriptFix AvailableA PR has been opened for this issueA PR has been opened for this issueNeeds InvestigationThis issue needs a team member to investigate its status.This issue needs a team member to investigate its status.
Milestone
Description
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
Metadata
Metadata
Assignees
Labels
BugA bug in TypeScriptA bug in TypeScriptFix AvailableA PR has been opened for this issueA PR has been opened for this issueNeeds InvestigationThis issue needs a team member to investigate its status.This issue needs a team member to investigate its status.