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

Unified Diff: tests/language_strong/tearoff_dynamic_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 | « tests/language_strong/covariant_subtyping_unsafe_call3_test.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/language_strong/tearoff_dynamic_test.dart
diff --git a/tests/language_strong/covariant_subtyping_unsafe_call1_test.dart b/tests/language_strong/tearoff_dynamic_test.dart
similarity index 52%
copy from tests/language_strong/covariant_subtyping_unsafe_call1_test.dart
copy to tests/language_strong/tearoff_dynamic_test.dart
index 79fced239fae75c0396c9b98a9c4bf2c5d9d7b56..9d324d6a6347cccaa9d6e179da32766e4376d23b 100644
--- a/tests/language_strong/covariant_subtyping_unsafe_call1_test.dart
+++ b/tests/language_strong/tearoff_dynamic_test.dart
@@ -3,12 +3,16 @@
// BSD-style license that can be found in the LICENSE file.
import 'package:expect/expect.dart';
-class Foo<T> {
- method(T x) {}
+class Foo {
+ dynamic method(int x) {}
}
main() {
- Foo<int> intFoo = new Foo<int>();
- Foo<num> numFoo = intFoo;
- Expect.throws(() => numFoo.method(2.5));
+ Foo foo = new Foo();
+
+ dynamic dynamicMethod1 = foo.method;
+ Expect.throws(() => dynamicMethod1(2.5));
+
+ dynamic dynamicMethod2 = (foo as dynamic).method;
+ Expect.throws(() => dynamicMethod2(2.5));
}
« no previous file with comments | « tests/language_strong/covariant_subtyping_unsafe_call3_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698