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

Unified Diff: tests/language_strong/covariant_subtyping_tearoff1_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
« no previous file with comments | « no previous file | tests/language_strong/covariant_subtyping_tearoff2_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/language_strong/covariant_subtyping_tearoff1_test.dart
diff --git a/tests/language_strong/covariant_subtyping_unsafe_call1_test.dart b/tests/language_strong/covariant_subtyping_tearoff1_test.dart
similarity index 65%
copy from tests/language_strong/covariant_subtyping_unsafe_call1_test.dart
copy to tests/language_strong/covariant_subtyping_tearoff1_test.dart
index 79fced239fae75c0396c9b98a9c4bf2c5d9d7b56..404b4bbdeb54494094630cd94df51404be1ca667 100644
--- a/tests/language_strong/covariant_subtyping_unsafe_call1_test.dart
+++ b/tests/language_strong/covariant_subtyping_tearoff1_test.dart
@@ -4,11 +4,16 @@
import 'package:expect/expect.dart';
class Foo<T> {
- method(T x) {}
+ dynamic method(T x) {}
}
+typedef dynamic TakeNum(num x);
+
main() {
Foo<int> intFoo = new Foo<int>();
Foo<num> numFoo = intFoo;
- Expect.throws(() => numFoo.method(2.5));
+ TakeNum f = numFoo.method;
+ Expect.throws(() => f(2.5));
+ dynamic f2 = numFoo.method;
+ Expect.throws(() => f2(2.5));
}
« no previous file with comments | « no previous file | tests/language_strong/covariant_subtyping_tearoff2_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698