Skip to content

DDC failing for tests/language/invalid_returns/async_valid_returns_test #41900

Closed
@rileyporter

Description

@rileyporter

DDC is failing with CompileTimeErrors for tests/language/invalid_returns/async_valid_returns_test.dart. Here is a link to the failing logs.

Example code causing the error:

int vi = 0;
Future<int> async_dynamic_to_Future_int__e() async =>
    vi as dynamic; // No await.

Example CompileTimeError for that code:

org-dartlang-app:/tests/language/invalid_returns/async_valid_returns_test.dart:489:8: Error: A value of type 'Future<dynamic>' can't be assigned to a variable of type 'FutureOr<int>'.
 - 'Future' is from 'dart:async'.
 - 'FutureOr' is from 'dart:async'.
    vi as dynamic; // No await.
       ^

I reached out to Erik, and he verified that with null-safe assignability rules this test should be valid since dynamic is assignable to int. It sounds like the spec has changed and this may be a new requirement with null-safety.

Metadata

Metadata

Assignees

No one assigned

    Labels

    NNBDIssues related to NNBD Releaselegacy-area-front-endLegacy: Use area-dart-model instead.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions