-
Notifications
You must be signed in to change notification settings - Fork 13k
Open
Labels
Fix 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.
Description
Bug Report
π Search Terms
- string literal
- strictNullChecks
- keyof
π Version & Regression Information
It works properly on v4.7.4 but is failing on v4.8.2 and with the nightly build.
It also works normally when strictNullChecks
is true
.
β― Playground Link
Playground link with relevant code
π» Code
type Model = { s: string; b: boolean }
let pick: <Keys extends keyof Model>(properties: readonly Keys[]) => Pick<Model, Keys>
let transform: <T>(obj: T) => T
const result1 = transform(pick(["s"]))
const intermediate = pick(["s"])
const result2 = transform(intermediate)
π Actual behavior
result1
has a type of Pick<Model, keyof Model>
and result2
as a type of Pick<Model, "s">
π Expected behavior
result1
and result2
should have the same type Pick<Model, "s">
.
Metadata
Metadata
Assignees
Labels
Fix 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.