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

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

Issue 2801683004: Reify implicit casts for FutureOr (Closed)
Patch Set: Add back FutureOr case Created 3 years, 8 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/test/src/task/strong/checker_test.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/inferred_type_test.dart
diff --git a/pkg/analyzer/test/src/task/strong/inferred_type_test.dart b/pkg/analyzer/test/src/task/strong/inferred_type_test.dart
index bdfa015aa58b58f9c37088502beaf0a8d1015ddd..9a1eb829f5a2a0c405b4182cf9fb3f649d3d1800 100644
--- a/pkg/analyzer/test/src/task/strong/inferred_type_test.dart
+++ b/pkg/analyzer/test/src/task/strong/inferred_type_test.dart
@@ -1656,7 +1656,7 @@ void main() {
$downwards<int> t1 = f.then(/*info:INFERRED_TYPE_CLOSURE*/
(x) async => x ? 2 : await new $upwards<int>.value(3));
$downwards<int> t2 = f.then(/*info:INFERRED_TYPE_CLOSURE,info:INFERRED_TYPE_CLOSURE*/(x) async { // TODO(leafp): Why the duplicate here?
- return await x ? 2 : new $upwards<int>.value(3);});
+ return /*info:DOWN_CAST_COMPOSITE*/await x ? 2 : new $upwards<int>.value(3);});
$downwards<int> t5 = f.then(/*info:INFERRED_TYPE_CLOSURE,error:INVALID_CAST_FUNCTION_EXPR*/
(x) => x ? 2 : new $upwards<int>.value(3));
$downwards<int> t6 = f.then(/*info:INFERRED_TYPE_CLOSURE*/
@@ -1694,7 +1694,7 @@ void main() {
$downwards<int> t1 = f.then(/*info:INFERRED_TYPE_CLOSURE*/
(x) async => x ? 2 : await new $upwards<int>.value(3));
$downwards<int> t2 = f.then(/*info:INFERRED_TYPE_CLOSURE,info:INFERRED_TYPE_CLOSURE*/(x) async { // TODO(leafp): Why the duplicate here?
- return await x ? 2 : new $upwards<int>.value(3);});
+ return /*info:DOWN_CAST_COMPOSITE*/await x ? 2 : new $upwards<int>.value(3);});
$downwards<int> t5 = f.then(/*info:INFERRED_TYPE_CLOSURE*/
(x) => x ? 2 : new $upwards<int>.value(3));
$downwards<int> t6 = f.then(/*info:INFERRED_TYPE_CLOSURE,info:INFERRED_TYPE_CLOSURE*/
@@ -1872,12 +1872,12 @@ class MyFuture<T> implements Future<T> {
}
$downwards<int> g1(bool x) async {
- return x ? 42 : /*info:INFERRED_TYPE_ALLOCATION*/new $upwards.value(42); }
+ return /*info:DOWN_CAST_COMPOSITE*/x ? 42 : /*info:INFERRED_TYPE_ALLOCATION*/new $upwards.value(42); }
$downwards<int> g2(bool x) async =>
- x ? 42 : /*info:INFERRED_TYPE_ALLOCATION*/new $upwards.value(42);
+ /*info:DOWN_CAST_COMPOSITE*/x ? 42 : /*info:INFERRED_TYPE_ALLOCATION*/new $upwards.value(42);
$downwards<int> g3(bool x) async {
var y = x ? 42 : new $upwards.value(42);
- return y;
+ return /*info:DOWN_CAST_COMPOSITE*/y;
}
''';
await checkFileElement(build(downwards: "Future", upwards: "Future"));
@@ -1897,12 +1897,12 @@ class MyFuture<T> implements Future<T> {
}
$downwards<int> g1(bool x) async {
- return x ? 42 : /*info:INFERRED_TYPE_ALLOCATION*/new $upwards.value(42); }
+ return /*info:DOWN_CAST_COMPOSITE*/x ? 42 : /*info:INFERRED_TYPE_ALLOCATION*/new $upwards.value(42); }
$downwards<int> g2(bool x) async =>
- x ? 42 : /*info:INFERRED_TYPE_ALLOCATION*/new $upwards.value(42);
+ /*info:DOWN_CAST_COMPOSITE*/x ? 42 : /*info:INFERRED_TYPE_ALLOCATION*/new $upwards.value(42);
$downwards<int> g3(bool x) async {
var y = x ? 42 : new $upwards.value(42);
- return y;
+ return /*info:DOWN_CAST_COMPOSITE*/y;
}
''';
await checkFileElement(build(downwards: "Future", upwards: "Future"));
« no previous file with comments | « pkg/analyzer/test/src/task/strong/checker_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698