| library; |
| import self as self; |
| import "dart:core" as core; |
| |
| class A extends core::Object { |
| synthetic constructor •() → self::A |
| : super core::Object::•() |
| ; |
| get bar() → core::int { |
| self::count = self::count.{core::num::+}(1){(core::num) → core::int}; |
| core::print("OK"); |
| return 42; |
| } |
| } |
| static field core::int count = 0; |
| static method main() → dynamic { |
| { |
| final synthesized self::A #0#0 = new self::A::•(); |
| if(!(let final core::int #t1 = #0#0.{self::A::bar}{core::int} in true)) |
| throw{for-error-handling} new core::StateError::•("Pattern matching error"); |
| } |
| self::expect(1, self::count); |
| } |
| static method expect(dynamic expected, dynamic actual) → dynamic { |
| if(!(expected =={core::Object::==}{(core::Object) → core::bool} actual)) |
| throw "Expected ${expected}, actual ${actual}"; |
| } |