| library /*isNonNullableByDefault*/; |
| 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 var2 = #C2; |
| static const field core::int var3 = #C3; |
| static const field core::int var4 = #C4; |
| static method fn(core::int a) → core::int { |
| core::int b = a; |
| core::int i = 0; |
| while (i.{core::num::<}(2)) { |
| b = b.{core::num::+}(a); |
| i = i.{core::num::+}(1); |
| } |
| return b; |
| } |
| static method fn1(core::int a) → core::int { |
| core::int b = a; |
| while (true) { |
| b = b.{core::num::*}(3); |
| if(b.{core::num::>}(10)) |
| return b; |
| } |
| } |
| static method main() → void { |
| exp::Expect::equals(#C1, 6); |
| exp::Expect::equals(#C2, 9); |
| exp::Expect::equals(#C3, 18); |
| exp::Expect::equals(#C4, 27); |
| } |
| |
| constants { |
| #C1 = 6 |
| #C2 = 9 |
| #C3 = 18 |
| #C4 = 27 |
| } |