Skip to content

T[K] is not assignable to NonNullable<T>[K] even when T is nonnull (regression) #27456

Closed
@falsandtru

Description

@falsandtru

TypeScript Version: 3.2.0-dev.20180929

Search Terms:

Code

Revert the change of source code to see the error: falsandtru/clientchannel@14cc53a

Expected behavior:

pass

Actual behavior:

TypeScript error: src/layer/domain/indexeddb/service/channel.ts(48,15): Error TS2322: Type 'V[Exclude<keyof V, "__meta" | "__id" | "__key" | "__date" | "__event">] | undefined' is not assignable to type 'NonNullable<Partial<V>>[Exclude<keyof V, "__meta" | "__id" | "__key" | "__date" | "__event">]'.
  Type 'undefined' is not assignable to type 'NonNullable<Partial<V>>[Exclude<keyof V, "__meta" | "__id" | "__key" | "__date" | "__event">]'.

Playground Link:

Related Issues:

Metadata

Metadata

Assignees

No one assigned

    Labels

    Needs More InfoThe issue still hasn't been fully clarified

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions