Skip to content
This repository has been archived by the owner on May 10, 2022. It is now read-only.

Dart 2 runtime failures in tests #5

Open
keertip opened this issue May 2, 2018 · 3 comments
Open

Dart 2 runtime failures in tests #5

keertip opened this issue May 2, 2018 · 3 comments
Labels

Comments

@keertip
Copy link

keertip commented May 2, 2018

type 'Future' is not a subtype of type 'FutureOr' of 'function result' where
Future is from dart:async
FutureOr is from dart:async
Response is from package:shelf/src/response.dart

package:shelf_test_handler/src/handler.dart ShelfTestHandler.call
../../shelf_test_handler/test/handler_test.dart 21:35 main..

00:03 +0: loading shelf_test_handler/test/server_test.dart
00:03 +0: serves a ShelfTestHandler ERROR - 2018-05-01 22:50:24.936098
GET /
Error thrown by handler.
type 'Future' is not a subtype of type 'FutureOr' of 'function result' where
Future is from dart:async
FutureOr is from dart:async
Response is from package:shelf/src/response.dart

package:shelf_test_handler/src/handler.dart ShelfTestHandler.call
package:shelf/shelf_io.dart 88:29 handleRequest

@kevmoo kevmoo assigned nex3 and unassigned kevmoo May 2, 2018
@nex3
Copy link
Contributor

nex3 commented May 2, 2018

I can't reproduce this with Dart 2.0.0-dev.52.0. Both dart --preview-dart-2 test/server_test.dart and dart --preview-dart-2 test/handler_test.dart complete successfully.

Are you sure you ran pub upgrade before testing?

@kevmoo
Copy link
Contributor

kevmoo commented Jun 26, 2018

Can reproduce this with -dev.65

Minimal repo

import 'dart:async';
import 'package:test/test.dart';

void main() {
  test('sample', () async {
    var result = await _something();
    expect(result, 42);
  });
}

FutureOr<int> _something() async => 42;

@kevmoo kevmoo added the blocked label Jun 26, 2018
@kevmoo
Copy link
Contributor

kevmoo commented Jun 26, 2018

Root issue: dart-lang/sdk#33639

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Development

No branches or pull requests

3 participants