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

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

Issue 2916633002: Remove TODOs from KernelConditionalExpression._inferExpression. (Closed)
Patch Set: Created 3 years, 7 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/conditional_upwards_inference.dart
diff --git a/pkg/front_end/testcases/inference/conditional_upwards_inference.dart b/pkg/front_end/testcases/inference/conditional_upwards_inference.dart
new file mode 100644
index 0000000000000000000000000000000000000000..f31287b5146d311d490477c4734832f9f9d454ad
--- /dev/null
+++ b/pkg/front_end/testcases/inference/conditional_upwards_inference.dart
@@ -0,0 +1,19 @@
+// Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+/*@testedFeatures=inference*/
+library test;
+
+class C<T> {
+ C(List<T> x);
+}
+
+main() {
+ bool b = false;
+ List<int> l1 = /*@typeArgs=int*/ [1];
+ List<int> l2 = /*@typeArgs=int*/ [2];
+ var /*@type=C<int>*/ x = new /*@typeArgs=int*/ C(l1);
+ var /*@type=C<int>*/ y = new /*@typeArgs=int*/ C(l2);
+ var /*@type=C<int>*/ z = new /*@typeArgs=int*/ C(b ? l1 : l2);
+}

Powered by Google App Engine
This is Rietveld 408576698