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

Unified Diff: tests/language/call_nonexistent_static_test.dart

Issue 10908236: Convert static error to warning for calls to toplevel methods, getters and setters. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Changed test. Created 8 years, 3 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/co19/co19-dart2js.status ('k') | tests/language/language.status » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/language/call_nonexistent_static_test.dart
diff --git a/tests/language/call_nonexistent_static_test.dart b/tests/language/call_nonexistent_static_test.dart
index 4eb206a4d1f7b865eff404c4d5e02a0a9fdc299b..dca8536c41dc6d8584da3fcbbbf00d8c94edf3fe 100644
--- a/tests/language/call_nonexistent_static_test.dart
+++ b/tests/language/call_nonexistent_static_test.dart
@@ -7,8 +7,94 @@
class C {}
+class D {
+ get hest => 1; /// 04: continued
+ set hest(val) {} /// 05: continued
+}
+
+get fisk => 2; /// 09: continued
+set fisk(val) {} /// 10: continued
+
+expectNsme([void fun()]) {
+ if (fun != null) {
+ Expect.throws(fun, (e) => e is NoSuchMethodError);
+ }
+}
+
+alwaysThrows() {
+ throw new NoSuchMethodError(null, 'foo', []);
+}
+
+test01() {
+ C.hest = 1; /// 01: static type warning
+}
+
+test02() {
+ C.hest; /// 02: static type warning
+}
+
+test03() {
+ C.hest(); /// 03: static type warning
+}
+
+test04() {
+ D.hest = 1; /// 04: static type warning
+}
+
+test05() {
+ D.hest; /// 05: static type warning
+}
+
+test06() {
+ fisk = 1; /// 06: static type warning
+}
+
+test07() {
+ fisk; /// 07: static type warning
+}
+
+test08() {
+ fisk(); /// 08: static type warning
+}
+
+test09() {
+ fisk = 1; /// 09: static type warning
+}
+
+test10() {
+ fisk; /// 10: static type warning
+}
+
main() {
- Expect.throws(() => C.hest = 1, (e) => e is NoSuchMethodError); /// 01: static type warning
- Expect.throws(() => C.hest, (e) => e is NoSuchMethodError); /// 02: static type warning
- Expect.throws(() => C.hest(), (e) => e is NoSuchMethodError); /// 03: static type warning
+ expectNsme(alwaysThrows);
+ expectNsme(
+ test01 /// 01: continued
+ );
+ expectNsme(
+ test02 /// 02: continued
+ );
+ expectNsme(
+ test03 /// 03: continued
+ );
+ expectNsme(
+ test04 /// 04: continued
+ );
+ expectNsme(
+ test05 /// 05: continued
+ );
+ expectNsme(
+ test06 /// 06: continued
+ );
+ expectNsme(
+ test07 /// 07: continued
+ );
+ expectNsme(
+ test08 /// 08: continued
+ );
+ expectNsme(
+ test09 /// 09: continued
+ );
+ expectNsme(
+ test10 /// 10: continued
+ );
}
« no previous file with comments | « tests/co19/co19-dart2js.status ('k') | tests/language/language.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698