Skip to content

Some Future.catchError onError callbacks are missing returns #105750

@srawlins

Description

@srawlins

See this code:

void main() async {
  await Future<int>.error('error').catchError((e) {});
}

This code is guaranteed to throw a runtime error. However, there is currently no static error reported. As part of dart-lang/sdk#49215, the dart analyzer will start to report static errors for code like this. Before analyzer can start reporting these static errors by default, the Flutter codebases must be cleaned of them.

Metadata

Metadata

Labels

P1High-priority issues at the top of the work listdependency: dartDart team may need to help usframeworkflutter/packages/flutter repository. See also f: labels.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions