-
Notifications
You must be signed in to change notification settings - Fork 13.2k
Fixed an issue with mapped property symbol not displaying added | undefined when its origin symbol was optional
#59957
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from 11 commits
93bd2fb
73be18f
1ac60dd
896e0ea
28a0160
6148904
267bbe8
2e2526a
0f06ca4
d3f0908
cfbeb73
c1e282a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,29 @@ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| /// <reference path="./fourslash.ts"/> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| // @strict: true | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| // @exactOptionalPropertyTypes: true | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| // https://github.com/microsoft/TypeScript/issues/59948 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| //// type OptionalToUnionWithUndefined<T> = { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| //// [K in keyof T]: T extends Record<K, T[K]> ? T[K] : T[K] | undefined; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| //// }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| //// | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| //// type Intermidiate/*1*/ = OptionalToUnionWithUndefined<{ a?: string }>; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| //// type Literal/*2*/ = { a?: string | undefined }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| //// | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| //// type Res1/*3*/ = Required<Intermidiate>; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| //// type Res2/*4*/ = Required<Literal>; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| verify.quickInfoAt("1", `type Intermidiate = { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+12
to
+18
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| //// type Intermidiate/*1*/ = OptionalToUnionWithUndefined<{ a?: string }>; | |
| //// type Literal/*2*/ = { a?: string | undefined }; | |
| //// | |
| //// type Res1/*3*/ = Required<Intermidiate>; | |
| //// type Res2/*4*/ = Required<Literal>; | |
| verify.quickInfoAt("1", `type Intermidiate = { | |
| //// type Intermediate/*1*/ = OptionalToUnionWithUndefined<{ a?: string }>; | |
| //// type Literal/*2*/ = { a?: string | undefined }; | |
| //// | |
| //// type Res1/*3*/ = Required<Intermediate>; | |
| //// type Res2/*4*/ = Required<Literal>; | |
| verify.quickInfoAt("1", `type Intermediate = { |
Copilot
AI
Aug 23, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The type name 'Intermidiate' is misspelled. It should be 'Intermediate'.
| //// type Intermidiate/*1*/ = OptionalToUnionWithUndefined<{ a?: string }>; | |
| //// type Literal/*2*/ = { a?: string | undefined }; | |
| //// | |
| //// type Res1/*3*/ = Required<Intermidiate>; | |
| //// type Res2/*4*/ = Required<Literal>; | |
| verify.quickInfoAt("1", `type Intermidiate = { | |
| //// type Intermediate/*1*/ = OptionalToUnionWithUndefined<{ a?: string }>; | |
| //// type Literal/*2*/ = { a?: string | undefined }; | |
| //// | |
| //// type Res1/*3*/ = Required<Intermediate>; | |
| //// type Res2/*4*/ = Required<Literal>; | |
| verify.quickInfoAt("1", `type Intermediate = { |
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,26 @@ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| /// <reference path="./fourslash.ts"/> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| // @strict: true | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| //// type OptionalToUnionWithUndefined<T> = { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| //// [K in keyof T]: T extends Record<K, T[K]> ? T[K] : T[K] | undefined; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| //// }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| //// | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| //// type Intermidiate/*1*/ = OptionalToUnionWithUndefined<{ a?: string }>; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| //// type Literal/*2*/ = { a?: string | undefined }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| //// | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| //// type Res1/*3*/ = Required<Intermidiate>; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| //// type Res2/*4*/ = Required<Literal>; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| verify.quickInfoAt("1", `type Intermidiate = { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+9
to
+15
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| //// type Intermidiate/*1*/ = OptionalToUnionWithUndefined<{ a?: string }>; | |
| //// type Literal/*2*/ = { a?: string | undefined }; | |
| //// | |
| //// type Res1/*3*/ = Required<Intermidiate>; | |
| //// type Res2/*4*/ = Required<Literal>; | |
| verify.quickInfoAt("1", `type Intermidiate = { | |
| //// type Intermediate/*1*/ = OptionalToUnionWithUndefined<{ a?: string }>; | |
| //// type Literal/*2*/ = { a?: string | undefined }; | |
| //// | |
| //// type Res1/*3*/ = Required<Intermediate>; | |
| //// type Res2/*4*/ = Required<Literal>; | |
| verify.quickInfoAt("1", `type Intermediate = { |
Copilot
AI
Aug 23, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The type name 'Intermidiate' is misspelled. It should be 'Intermediate'.
| //// type Intermidiate/*1*/ = OptionalToUnionWithUndefined<{ a?: string }>; | |
| //// type Literal/*2*/ = { a?: string | undefined }; | |
| //// | |
| //// type Res1/*3*/ = Required<Intermidiate>; | |
| //// type Res2/*4*/ = Required<Literal>; | |
| verify.quickInfoAt("1", `type Intermidiate = { | |
| //// type Intermediate/*1*/ = OptionalToUnionWithUndefined<{ a?: string }>; | |
| //// type Literal/*2*/ = { a?: string | undefined }; | |
| //// | |
| //// type Res1/*3*/ = Required<Intermediate>; | |
| //// type Res2/*4*/ = Required<Literal>; | |
| verify.quickInfoAt("1", `type Intermediate = { |
Copilot
AI
Aug 23, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The type name 'Intermidiate' is misspelled. It should be 'Intermediate'.
| //// type Intermidiate/*1*/ = OptionalToUnionWithUndefined<{ a?: string }>; | |
| //// type Literal/*2*/ = { a?: string | undefined }; | |
| //// | |
| //// type Res1/*3*/ = Required<Intermidiate>; | |
| //// type Res2/*4*/ = Required<Literal>; | |
| verify.quickInfoAt("1", `type Intermidiate = { | |
| //// type Intermediate/*1*/ = OptionalToUnionWithUndefined<{ a?: string }>; | |
| //// type Literal/*2*/ = { a?: string | undefined }; | |
| //// | |
| //// type Res1/*3*/ = Required<Intermediate>; | |
| //// type Res2/*4*/ = Required<Literal>; | |
| verify.quickInfoAt("1", `type Intermediate = { |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| /// <reference path="./fourslash.ts"/> | ||
|
|
||
| // https://github.com/microsoft/TypeScript/issues/60411 | ||
|
|
||
| // @strict: true | ||
|
|
||
| //// type UnsetUndefinedToOblivion<T> = { [P in keyof T]-?: T[P] | undefined }; | ||
| //// type SetUndefined<T> = { [P in keyof T]: T[P] | undefined }; | ||
| //// type TheWhat/**/ = SetUndefined<UnsetUndefinedToOblivion<{ a?: 1 }>>; | ||
|
|
||
| verify.quickInfoAt("", `type TheWhat = { | ||
| a: 1 | undefined; | ||
| }`); |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| // @strict: true | ||
|
|
||
| //// type A/*1*/ = { [K in keyof { a?: string }]-?: string } | ||
| //// type B/*2*/ = { [K in keyof A]: string | undefined } | ||
|
|
||
| verify.quickInfoAt("1", `type A = { | ||
| a: string; | ||
| }`); | ||
| verify.quickInfoAt("2", `type B = { | ||
| a: string | undefined; | ||
| }`); |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| // @strict: true | ||
|
|
||
| // https://github.com/microsoft/TypeScript/issues/62325 | ||
|
|
||
| //// type RequiredKeys<T extends object> = { | ||
| //// [K in keyof Required<T>]: T[K]; | ||
| //// }; | ||
| //// | ||
| //// type Foo = { | ||
| //// a?: string; | ||
| //// b?: number; | ||
| //// c: string; | ||
| //// d: boolean | undefined; | ||
| //// }; | ||
| //// | ||
| //// type Bar/*1*/ = RequiredKeys<Foo>; | ||
|
|
||
| verify.quickInfoAt("1", `type Bar = { | ||
| a: string | undefined; | ||
| b: number | undefined; | ||
| c: string; | ||
| d: boolean | undefined; | ||
| }`); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The type name 'Intermidiate' is misspelled. It should be 'Intermediate'.