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); |
+} |