-
Notifications
You must be signed in to change notification settings - Fork 13.2k
Closed as not planned
Labels
DuplicateAn existing issue was already createdAn existing issue was already created
Description
π Search Terms
undefined forever
β― Playground Link
π» Code
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 }>>π Actual behavior
type TheWhat = {
a: 1;
}π Expected behavior
type TheWhat = {
a: 1 | undefined;
}Additional information about the issue
Temporary fix:
type UnsetTheUnset<T> = { [P in keyof T & {}]: T[P] }
type TheWhat = SetUndefined<UnsetTheUnset<UnsetUndefinedToOblivion<{ a?: 1 }>>>Semigradsky and jcalz
Metadata
Metadata
Assignees
Labels
DuplicateAn existing issue was already createdAn existing issue was already created