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

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

Issue 2846103002: Generated front_end/testcases/inference test files from Analyzer tests. (Closed)
Patch Set: 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
Index: pkg/front_end/testcases/inference/downwards_inference_on_function_arguments_infer_downwards.dart
diff --git a/pkg/front_end/testcases/inference/downwards_inference_on_function_arguments_infer_downwards.dart b/pkg/front_end/testcases/inference/downwards_inference_on_function_arguments_infer_downwards.dart
new file mode 100644
index 0000000000000000000000000000000000000000..c240995ac01bb4ee2edca7ce16d15af7821b300f
--- /dev/null
+++ b/pkg/front_end/testcases/inference/downwards_inference_on_function_arguments_infer_downwards.dart
@@ -0,0 +1,55 @@
+// 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;
+
+void f0(List<int> a) {}
+void f1({List<int> a}) {}
+void f2(Iterable<int> a) {}
+void f3(Iterable<Iterable<int>> a) {}
+void f4({Iterable<Iterable<int>> a}) {}
+void main() {
+ f0(/*@typeArgs=int*/ []);
+ f0(/*@typeArgs=int*/ [3]);
+ f0(/*@typeArgs=int*/ [/*error:LIST_ELEMENT_TYPE_NOT_ASSIGNABLE*/ "hello"]);
+ f0(/*@typeArgs=int*/ [/*error:LIST_ELEMENT_TYPE_NOT_ASSIGNABLE*/ "hello", 3]);
+
+ f1(a: /*@typeArgs=int*/ []);
+ f1(a: /*@typeArgs=int*/ [3]);
+ f1(a: /*@typeArgs=int*/ [/*error:LIST_ELEMENT_TYPE_NOT_ASSIGNABLE*/ "hello"]);
+ f1(a: /*@typeArgs=int*/ [
+ /*error:LIST_ELEMENT_TYPE_NOT_ASSIGNABLE*/ "hello",
+ 3
+ ]);
+
+ f2(/*@typeArgs=int*/ []);
+ f2(/*@typeArgs=int*/ [3]);
+ f2(/*@typeArgs=int*/ [/*error:LIST_ELEMENT_TYPE_NOT_ASSIGNABLE*/ "hello"]);
+ f2(/*@typeArgs=int*/ [/*error:LIST_ELEMENT_TYPE_NOT_ASSIGNABLE*/ "hello", 3]);
+
+ f3(/*@typeArgs=Iterable<int>*/ []);
+ f3(/*@typeArgs=Iterable<int>*/ [
+ /*@typeArgs=int*/ [3]
+ ]);
+ f3(/*@typeArgs=Iterable<int>*/ [
+ /*@typeArgs=int*/ [/*error:LIST_ELEMENT_TYPE_NOT_ASSIGNABLE*/ "hello"]
+ ]);
+ f3(/*@typeArgs=Iterable<int>*/ [
+ /*@typeArgs=int*/ [/*error:LIST_ELEMENT_TYPE_NOT_ASSIGNABLE*/ "hello"],
+ /*@typeArgs=int*/ [3]
+ ]);
+
+ f4(a: /*@typeArgs=Iterable<int>*/ []);
+ f4(a: /*@typeArgs=Iterable<int>*/ [
+ /*@typeArgs=int*/ [3]
+ ]);
+ f4(a: /*@typeArgs=Iterable<int>*/ [
+ /*@typeArgs=int*/ [/*error:LIST_ELEMENT_TYPE_NOT_ASSIGNABLE*/ "hello"]
+ ]);
+ f4(a: /*@typeArgs=Iterable<int>*/ [
+ /*@typeArgs=int*/ [/*error:LIST_ELEMENT_TYPE_NOT_ASSIGNABLE*/ "hello"],
+ /*@typeArgs=int*/ [3]
+ ]);
+}

Powered by Google App Engine
This is Rietveld 408576698