Make cyclic error init more complicated to avoid static warnings.

Review URL: https://codereview.chromium.org//18433003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@24728 260f80e4-7a28-3924-810f-c04153c831b5
This commit is contained in:
floitsch@google.com
2013-07-03 15:06:50 +00:00
parent 438767ca3a
commit 9447db144e
+9 -2
View File
@@ -4,7 +4,12 @@
import "package:expect/expect.dart";
var cyclicStatic = cyclicStatic + 1;
class A {
get foo => cyclicStatic;
}
var a = new A();
var cyclicStatic = (() => a.foo + 1)();
cyclicInitialization() {
return cyclicStatic;
@@ -14,7 +19,9 @@ main() {
bool hasThrown = false;
try {
cyclicStatic + 1;
} catch(e) {
} catch(e2) {
// Work around bug in analyzer that assigns "Object" type to caught error.
var e = e2;
hasThrown = true;
Expect.isTrue(e.stackTrace is StackTrace,
"$e doesn't have a non-null stack trace");