Open
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">
.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment