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

Unified Diff: test/codegen/language/function_subtype_regression_ddc_588_test.dart

Issue 2069653003: Fix function subtyping crash (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: Created 4 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
« no previous file with comments | « lib/runtime/dart_sdk.js ('k') | tool/input_sdk/private/ddc_runtime/types.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/codegen/language/function_subtype_regression_ddc_588_test.dart
diff --git a/test/codegen/language/function_subtype_regression_ddc_588_test.dart b/test/codegen/language/function_subtype_regression_ddc_588_test.dart
new file mode 100644
index 0000000000000000000000000000000000000000..ece2757b97e145d717342e312cef9eaf89ee7256
--- /dev/null
+++ b/test/codegen/language/function_subtype_regression_ddc_588_test.dart
@@ -0,0 +1,14 @@
+import "package:expect/expect.dart";
+
+// regression test for ddc #588
+
+typedef int Int2Int(int x);
+
+void foo(List<Int2Int> list) {
+ list.forEach((f) => print(f(42)));
+}
+
+void main() {
+ var l = <Function>[];
+ Expect.throws(() => foo(l), (e) => e is TypeError);
+}
« no previous file with comments | « lib/runtime/dart_sdk.js ('k') | tool/input_sdk/private/ddc_runtime/types.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698