Index: tests/language_strong/covariant_subtyping_tearoff2_test.dart |
diff --git a/tests/language_strong/covariant_subtyping_unsafe_call2_test.dart b/tests/language_strong/covariant_subtyping_tearoff2_test.dart |
similarity index 72% |
copy from tests/language_strong/covariant_subtyping_unsafe_call2_test.dart |
copy to tests/language_strong/covariant_subtyping_tearoff2_test.dart |
index ea5920384df7cd4e5a73ecfb0d1595d2e5090864..306d83ddf6d9863f66067ece1969bbce12705d29 100644 |
--- a/tests/language_strong/covariant_subtyping_unsafe_call2_test.dart |
+++ b/tests/language_strong/covariant_subtyping_tearoff2_test.dart |
@@ -4,18 +4,23 @@ |
import 'package:expect/expect.dart'; |
class Implementation { |
- method(int x) {} |
+ dynamic method(int x) {} |
} |
abstract class Interface<T> { |
- method(T x); |
+ dynamic method(T x); |
} |
class Subclass extends Implementation implements Interface<int> {} |
+typedef dynamic TakeNum(num x); |
+ |
main() { |
Subclass subclass = new Subclass(); |
Interface<int> intInterface = subclass; |
Interface<num> numInterface = intInterface; |
- Expect.throws(() => numInterface.method(2.5)); |
+ TakeNum f = numInterface.method; |
+ Expect.throws(() => f(2.5)); |
+ dynamic f2 = f; |
+ Expect.throws(() => f2(2.5)); |
} |