Index: tests/language/function_subtype_closure0_test.dart |
diff --git a/tests/language/function_subtype_closure0_test.dart b/tests/language/function_subtype_closure0_test.dart |
new file mode 100644 |
index 0000000000000000000000000000000000000000..13645be9edd316bf707db34a984bb0745aa6e636 |
--- /dev/null |
+++ b/tests/language/function_subtype_closure0_test.dart |
@@ -0,0 +1,25 @@ |
+// Copyright (c) 2013, 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. |
+// Dart test program for constructors and initializers. |
+ |
+// Check function subtyping of static closures. |
karlklose
2013/06/20 13:11:04
'closures' -> 'functions'?
Johnni Winther
2013/06/21 12:19:15
Done.
|
+ |
+import 'package:expect/expect.dart'; |
karlklose
2013/06/20 13:11:04
Currently this is not used.
Johnni Winther
2013/06/21 12:19:15
It is now.
|
+ |
+typedef I<T> f2<T>(); |
+ |
+class X { |
+ static J<bool> f1() => null; |
+} |
+ |
+class C<T> { |
+ C(f2<T> f, C<J> c); |
karlklose
2013/06/20 13:11:04
Why this second argument?
Johnni Winther
2013/06/21 12:19:15
Not needed. Removed.
|
+} |
+ |
+class I<T> {} |
+class J<T> extends I<int> {} |
+ |
+main() { |
+ new C<int>(X.f1, null); |
karlklose
2013/06/20 13:11:04
Please add a negative test, too. You'll have to wr
Johnni Winther
2013/06/21 12:19:15
Done.
|
+} |