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

Unified Diff: tests/language_strong/covariant_subtyping_tearoff2_test.dart

Issue 2725563003: Add some tests for calls with checks in strong mode. (Closed)
Patch Set: Created 3 years, 10 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: 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));
}

Powered by Google App Engine
This is Rietveld 408576698