Skip to content

Array/Observable filter does not infer chained type #19640

Closed
@topaxi

Description

@topaxi

TypeScript Version: 2.6.1 using strict: true

Code

[true, true, false, null]
  .filter(thing => thing !== null)
  .map(thing => thing.toString())

Expected behavior:

Compiles

Actual behavior:

3 col 17 error| 2531[QF available]: Object is possibly 'null'.

Metadata

Metadata

Assignees

No one assigned

    Labels

    DuplicateAn existing issue was already createdFixedA PR has been merged for this issue

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions