Skip to content

Omit from #31115 makes all properties required #31190

Closed
@InExtremaRes

Description

@InExtremaRes

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

pin @DanielRosenwasser

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugA bug in TypeScriptDomain: Conditional TypesThe issue relates to conditional typesDomain: Mapped TypesThe issue relates to mapped typesFixedA PR has been merged for this issue

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions