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

Unified Diff: pkg/front_end/testcases/inference/future_then_conditional_2.dart

Issue 2923733004: Properly flatten FutureOr types when inferring the type of an async method. (Closed)
Patch Set: Created 3 years, 6 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
Index: pkg/front_end/testcases/inference/future_then_conditional_2.dart
diff --git a/pkg/front_end/testcases/inference/future_then_conditional_2.dart b/pkg/front_end/testcases/inference/future_then_conditional_2.dart
index 0e31d933524eebf93c2a4ad575b7e613ad07bcf3..8f0a2b91df6338eb4dac5334799d457caace09a6 100644
--- a/pkg/front_end/testcases/inference/future_then_conditional_2.dart
+++ b/pkg/front_end/testcases/inference/future_then_conditional_2.dart
@@ -14,7 +14,7 @@ class MyFuture<T> implements Future<T> {
MyFuture<S> then<S>(FutureOr<S> f(T x), {Function onError}) => null;
}
-void main() {
+void test() {
MyFuture<bool> f;
Future<int> t1 = f. /*@typeArgs=int*/ /*@target=MyFuture::then*/ then(
/*@returnType=Future<int>*/ (/*@type=bool*/ x) async =>
@@ -34,3 +34,5 @@ void main() {
return /*info:DOWN_CAST_COMPOSITE*/ x ? 2 : new MyFuture<int>.value(3);
});
}
+
+main() {}

Powered by Google App Engine
This is Rietveld 408576698