-
Notifications
You must be signed in to change notification settings - Fork 12.9k
Closed
Closed
Copy link
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.RescheduledThis issue was previously scheduled to an earlier milestoneThis issue was previously scheduled to an earlier milestone
Milestone
Description
Bug Report
π Search Terms
suggestion pathof
π Version & Regression Information
4.7
β― Playground Link
Playground link with relevant code
π» Code
// get from https://github.com/microsoft/TypeScript/issues/20423#issuecomment-812564842
type PathOf<T, K extends string, P extends string = ""> =
K extends `${infer U}.${infer V}`
? U extends keyof T ? PathOf<T[U], V, `${P}${U}.`> : `${P}${keyof T & (string | number)}`
: K extends keyof T ? `${P}${K}` : `${P}${keyof T & (string | number)}`;
declare function consumer<K extends string>(path: PathOf<{a: string, b: {c: string}}, K>) : number;
// suggestion works well in 4.6, and not work in 4.7
consumer('b.')
π Actual behavior
π Expected behavior
itsUndefined
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.RescheduledThis issue was previously scheduled to an earlier milestoneThis issue was previously scheduled to an earlier milestone