| library; |
| import self as self; |
| import "dart:core" as core; |
| |
| class B extends core::Object { |
| field core::num x; |
| field core::String y; |
| constructor •(core::num x, core::String y) → void |
| : self::B::x = x, self::B::y = y, super core::Object::•() { |
| self::events = self::events.+("super(${this.x}, ${this.y})\n"); |
| } |
| } |
| class C extends self::B { |
| final field dynamic z; |
| constructor •() → void |
| : final dynamic #t1 = self::f(1), final dynamic #t2 = self::g(2), self::C::z = self::f(3), super self::B::•(#t1, #t2) |
| ; |
| } |
| static field core::String events = ""; |
| static method f(dynamic x) → core::int { |
| self::events = self::events.+("f(${x})\n"); |
| return 0; |
| } |
| static method g(dynamic x) → core::String { |
| self::events = self::events.+("g(${x})\n"); |
| return "foo"; |
| } |
| static method main() → dynamic { |
| new self::C::•(); |
| if(!self::events.==("f(1)\ng(2)\nf(3)\nsuper(0, foo)\n")) { |
| throw "Unexpected sequence of events: ${self::events}"; |
| } |
| } |