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

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

Issue 2159033002: fix #26404, incorrect cast on async function return (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 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 | « 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 915f308e3dc0b8b6dd97f9b14627685084bb2979..739b24d0760175f9f8ec18c3fd8f0218992ee423 100644
--- a/pkg/analyzer/test/src/task/strong/checker_test.dart
+++ b/pkg/analyzer/test/src/task/strong/checker_test.dart
@@ -690,14 +690,14 @@ dynamic x;
foo1() async => x;
Future foo2() async => x;
-Future<int> foo3() async => /*info:DYNAMIC_CAST*/x;
+Future<int> foo3() async => x;
Future<int> foo4() async => new Future<int>.value(/*info:DYNAMIC_CAST*/x);
Future<int> foo5() async =>
/*error:RETURN_OF_INVALID_TYPE*/new Future<String>.value(/*info:DYNAMIC_CAST*/x);
bar1() async { return x; }
Future bar2() async { return x; }
-Future<int> bar3() async { return /*info:DYNAMIC_CAST*/x; }
+Future<int> bar3() async { return x; }
Future<int> bar4() async { return new Future<int>.value(/*info:DYNAMIC_CAST*/x); }
Future<int> bar5() async {
return /*error:RETURN_OF_INVALID_TYPE*/new Future<String>.value(/*info:DYNAMIC_CAST*/x);
@@ -713,7 +713,7 @@ baz() async {
String d = /*error:INVALID_ASSIGNMENT*/await z;
}
-Future<bool> get issue_264 async {
+Future<bool> get issue_ddc_264 async {
await 42;
if (new Random().nextBool()) {
return true;
@@ -721,6 +721,11 @@ Future<bool> get issue_264 async {
return new Future<bool>.value(false);
}
}
+
+
+Future<String> issue_sdk_26404() async {
+ return (1 > 0) ? new Future<String>.value('hello') : "world";
+}
''');
}
« 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