blob: 9ac1d767a22bedb49339aa83f6b8f998bc9655cd [file] [log] [blame]
library;
import self as self;
import "dart:core" as core;
import "package:expect/expect.dart" as exp;
class ImplicitScopeTest extends core::Object {
synthetic constructor •() void
: super core::Object::•()
;
static method alwaysTrue() core::bool {
return 1.{core::num::+}(1).{core::num::==}(2);
}
static method testMain() dynamic {
core::String a = "foo";
dynamic b;
if(self::ImplicitScopeTest::alwaysTrue()) {
dynamic a = "bar";
}
else {
dynamic b = a;
}
exp::Expect::equals("foo", a);
exp::Expect::equals(null, b);
while (!self::ImplicitScopeTest::alwaysTrue()) {
dynamic a = "bar";
dynamic b = "baz";
}
exp::Expect::equals("foo", a);
exp::Expect::equals(null, b);
for (core::int i = 0; i.{core::num::<}(10); i = i.{core::num::+}(1)) {
dynamic a = "bar";
dynamic b = "baz";
}
exp::Expect::equals("foo", a);
exp::Expect::equals(null, b);
do {
dynamic a = "bar";
dynamic b = "baz";
}
while ("black".{core::String::==}("white"))
exp::Expect::equals("foo", a);
exp::Expect::equals(null, b);
}
}
static method main() dynamic {
self::ImplicitScopeTest::testMain();
}