Skip to content

Dartdevk produces an error when null is returned from async function with return type dyncmic #44745

@sgrekhov

Description

@sgrekhov

The following co19 test fails on dartdevc compiler with Error: Expected a value of type 'Object', but got one of type 'Null'

Object test1() async {
  Object? o = null;
  return o;
}

dynamic test2() async {
  Object? o = null;
  return o;
}

main() {
  test1();
  test2();
}

Error log
This test works well on all other platforms and must pass on derdevk as well

Metadata

Metadata

Assignees

Labels

area-web-jsIssues related to JavaScript support for Dart Web, including DDC, dart2js, and JS interop.web-dev-compiler

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions