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

Unified Diff: pkg/analyzer/test/src/task/strong/checker_test.dart

Issue 1495263003: Allow return of Future in async function (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Rename duplicate tests Created 5 years 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 | « pkg/analyzer/lib/src/task/strong/checker.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/test/src/task/strong/checker_test.dart
diff --git a/pkg/analyzer/test/src/task/strong/checker_test.dart b/pkg/analyzer/test/src/task/strong/checker_test.dart
index 724a742ced5b8f092403d666a8e170b6995a70c5..2c862206191ee70c83775706bf5f057ebe69bdfe 100644
--- a/pkg/analyzer/test/src/task/strong/checker_test.dart
+++ b/pkg/analyzer/test/src/task/strong/checker_test.dart
@@ -2364,12 +2364,14 @@ void main() {
foo1() async => x;
Future foo2() async => x;
Future<int> foo3() async => (/*info:DynamicCast*/x);
- Future<int> foo4() async => (/*severe:StaticTypeError*/new Future<int>.value(/*info:DynamicCast*/x));
+ Future<int> foo4() async => (new Future<int>.value(/*info:DynamicCast*/x));
+ Future<int> foo5() async => (/*severe:StaticTypeError*/new Future<String>.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>.value(/*info:DynamicCast*/x)); }
+ Future<int> bar4() async { return (new Future<int>.value(/*info:DynamicCast*/x)); }
+ Future<int> bar5() async { return (/*severe:StaticTypeError*/new Future<String>.value(/*info:DynamicCast*/x)); }
int y;
Future<int> z;
@@ -2386,7 +2388,7 @@ void main() {
if (new Random().nextBool()) {
return true;
} else {
- return /*severe:StaticTypeError*/new Future<bool>.value(false);
+ return new Future<bool>.value(false);
}
}
'''
« no previous file with comments | « pkg/analyzer/lib/src/task/strong/checker.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698