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

Unified Diff: tests/language/crash_6725_test.dart

Issue 166433002: Revert "Fix language tests wrt. warnings." (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 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/crash_6725_part.dart ('k') | tests/language/default_factory_library_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/language/crash_6725_test.dart
diff --git a/tests/language/crash_6725_test.dart b/tests/language/crash_6725_test.dart
index 420111f5af67ca8a92d7115c454b03eff6f01d08..f9cbb18878bf338b1fdec71f521c8e3b6a37629c 100644
--- a/tests/language/crash_6725_test.dart
+++ b/tests/language/crash_6725_test.dart
@@ -4,10 +4,68 @@
// Regression test for a crash in dart2js.
-library crash_6725;
+class Fisk {
+ it1(x) {
+ // "key" is unresolved and caused a crash in dart2js.
+ // This is the original example the user reported.
+ for (key in x) {
+ print(key);
+ }
+ }
-part 'crash_6725_part.dart'; /// 01: static type warning
+ it2(x) {
+ // "length" is "intercepted" and handled differently from other
+ // names when an instance of list is observed.
+ for (length in x) {
+ print(length);
+ }
+ }
+
+ it3(x) {
+ // We're pretty sure that there's no "fisk" that is "intercepted".
+ for (fisk in x) {
+ print(fisk);
+ }
+ }
+}
+
+class SubFisk extends Fisk {
+ var key;
+ var length;
+ var fisk;
+}
main() {
- test(); /// 01: continued
+ Fisk f = new SubFisk();
+ var m = (x) {
+ for (undeclared in x) {
+ print(undeclared);
+ }
+ };
+ if (new DateTime.now().millisecondsSinceEpoch == 42) {
+ f = null;
+ m = (x) {};
+ }
+
+ f.it1([87, 42]);
+ if (f.key != 42) {
+ throw 'f.key != 42 (${f.key})';
+ }
+
+ f.it2([87, 42]);
+ if (f.length != 42) {
+ throw 'f.length != 42 (${f.length})';
+ }
+
+ f.it3([87, 42]);
+ if (f.fisk != 42) {
+ throw 'f.fisk != 42 (${f.fisk})';
+ }
+
+ try {
+ m([87, 42]);
+ throw 'NoSuchMethodError expected';
+ } on NoSuchMethodError {
+ // Expected.
+ }
}
« no previous file with comments | « tests/language/crash_6725_part.dart ('k') | tests/language/default_factory_library_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698