Skip to content

Stream.asyncMap bug in weak mode + nnbd sdk #41465

@jakemac53

Description

@jakemac53

If you return null from the closure passed Stream.asyncMap in weak mode (with the nnbd sdk) today you will hit an unreachable error.

Repro program:

void main() {
  var stream = Stream.fromIterable([1, 2, 3, 4]);
  var eventsStream =
      stream.asyncMap((i) => i % 2 == 0 ? i : null).where((i) => i != null);
  eventsStream.listen(print);
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    NNBDIssues related to NNBD ReleaseP1A high priority bug; for example, a single project is unusable or has many test failuresarea-core-librarySDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries.library-async

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions