-
Notifications
You must be signed in to change notification settings - Fork 13.2k
Closed
Labels
BugA bug in TypeScriptA bug in TypeScriptDomain: Conditional TypesThe issue relates to conditional typesThe issue relates to conditional typesDomain: Mapped TypesThe issue relates to mapped typesThe issue relates to mapped typesFixedA PR has been merged for this issueA PR has been merged for this issue
Description
Since the changes of #31115, Omit<T, K> makes all properties of T required.
TypeScript Version: 3.5.0-dev.20190501, 3.4.5
Search Terms: omit optional
Code
type A = {
a: number;
b?: string;
};
type B = Omit<A, 'a'>;Expected behavior: B is { b?: string } ({ b?: string | undefined } with strictNullChecks).
Actual behavior: B is { b: string } ({ b: string | undefined } with strictNullChecks), with property b required.
Playground Link: link
dragomirtitian, ctrlplusb and millspctrlplusb
Metadata
Metadata
Assignees
Labels
BugA bug in TypeScriptA bug in TypeScriptDomain: Conditional TypesThe issue relates to conditional typesThe issue relates to conditional typesDomain: Mapped TypesThe issue relates to mapped typesThe issue relates to mapped typesFixedA PR has been merged for this issueA PR has been merged for this issue