-
Notifications
You must be signed in to change notification settings - Fork 13k
Closed
Labels
BugA bug in TypeScriptA bug in TypeScriptFix AvailableA PR has been opened for this issueA PR has been opened for this issueRescheduledThis issue was previously scheduled to an earlier milestoneThis issue was previously scheduled to an earlier milestone
Milestone
Description
Bug Report
π Search Terms
type guard, nested conditional types
π Version & Regression Information
- This is a crash
- This changed between versions ______ and _______
- β This is the behavior in every version I tried, and I reviewed the FAQ for entries about _________
- I was unable to test this on prior versions because _______
β― Playground Link
Playground link with relevant code
π» Code
type AddPropToObject<Obj extends object, Prop extends string> = Prop extends keyof Obj
? Obj[Prop] extends unknown[]
? [...Obj[Prop]]
: never
: never
π Actual behavior
Obj[Prop]
is not viewed as an array.
π Expected behavior
Obj[Prop]
should be viewed as an array.
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 issueRescheduledThis issue was previously scheduled to an earlier milestoneThis issue was previously scheduled to an earlier milestone