| library; | |
| import self as self; | |
| import "dart:core" as core; | |
| import "package:expect/expect.dart" as exp; | |
| import "package:expect/expect.dart"; | |
| static const field core::int var1 = #C1; | |
| static const field core::int var3 = #C2; | |
| static const field core::int var4 = #C1; | |
| static method varAssignmentTest(core::int a) → core::int { | |
| core::int x = 4; | |
| { | |
| x = 3; | |
| } | |
| return x; | |
| } | |
| static method function() → core::int { | |
| function varAssignmentTest2() → core::int { | |
| core::int x = 2; | |
| x = x.{core::num::+}(1){(core::num) → core::int}; | |
| return x; | |
| } | |
| const core::int var2 = #C1; | |
| return #C1; | |
| } | |
| static method varAssignmentTest3(core::int a) → core::int { | |
| core::int x = 4; | |
| x = a.{core::num::+}(1){(core::num) → core::int}; | |
| return x; | |
| } | |
| static method main() → void { | |
| exp::Expect::equals(#C1, 3); | |
| exp::Expect::equals(self::function(), 3); | |
| exp::Expect::equals(#C2, 2); | |
| exp::Expect::equals(#C1, 3); | |
| } | |
| constants { | |
| #C1 = 3 | |
| #C2 = 2 | |
| } |