Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(319)

Unified Diff: test/checker/checker_test.dart

Issue 1252773002: add test related to #264 and #228 (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « lib/src/dart_sdk.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/checker/checker_test.dart
diff --git a/test/checker/checker_test.dart b/test/checker/checker_test.dart
index 1eee30980d8a1d454c193e1a35ab7bd38ccff6f9..d66094dcd3dab3ff40074113a89b7aa2588ca834 100644
--- a/test/checker/checker_test.dart
+++ b/test/checker/checker_test.dart
@@ -2675,18 +2675,19 @@ void main() {
test('async', () => testChecker({
'/main.dart': '''
import 'dart:async';
+ import 'dart:math' show Random;
dynamic x;
foo1() async => x;
Future foo2() async => x;
Future<int> foo3() async => (/*info:DynamicCast*/x);
- Future<int> foo4() async => (/*severe:StaticTypeError*/new Future<int>(x));
+ Future<int> foo4() async => (/*severe:StaticTypeError*/new Future<int>.value(/*info:DynamicCast*/x));
bar1() async { return x; }
Future bar2() async { return x; }
Future<int> bar3() async { return (/*info:DynamicCast*/x); }
- Future<int> bar4() async { return (/*severe:StaticTypeError*/new Future<int>(x)); }
+ Future<int> bar4() async { return (/*severe:StaticTypeError*/new Future<int>.value(/*info:DynamicCast*/x)); }
int y;
Future<int> z;
@@ -2700,7 +2701,11 @@ void main() {
Future<bool> get issue_264 async {
await 42;
- return false;
+ if (new Random().nextBool()) {
+ return true;
+ } else {
+ return /*severe:StaticTypeError*/new Future<bool>.value(false);
+ }
}
'''
}));
« no previous file with comments | « lib/src/dart_sdk.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698