OLD | NEW |
1 library; | 1 library; |
2 import self as self; | 2 import self as self; |
3 import "dart:core" as core; | 3 import "dart:core" as core; |
4 | 4 |
5 class A extends core::Object { | 5 class A extends core::Object { |
6 final field core::int x; | 6 final field core::int x; |
7 final field core::int y; | 7 final field core::int y; |
8 constructor •(core::int y) → void | 8 constructor •(core::int y) → void |
9 : self::A::y = y, self::A::x = 42, super core::Object::•() | 9 : self::A::y = y, self::A::x = 42, super core::Object::•() |
10 ; | 10 ; |
11 method method() → dynamic { | 11 method method() → dynamic { |
12 core::print("A.method x: ${this.x} y: ${this.y}"); | 12 core::print("A.method x: ${this.x} y: ${this.y}"); |
13 core::print(this); | 13 core::print(this); |
14 core::print(this.runtimeType); | 14 core::print(this.runtimeType); |
15 } | 15 } |
16 } | 16 } |
17 class B extends self::A { | 17 class B extends self::A { |
18 constructor •(dynamic x) → void | 18 constructor •(dynamic x) → void |
19 : super self::A::•(x) | 19 : super self::A::•(x) |
20 ; | 20 ; |
21 method method() → dynamic { | 21 method method() → dynamic { |
22 core::print("B.method x: ${this.x} y: ${this.y}"); | 22 core::print("B.method x: ${this.x} y: ${this.y}"); |
23 this.{=self::A::method}(); | 23 super.method(); |
24 } | 24 } |
25 } | 25 } |
26 static method main() → dynamic { | 26 static method main() → dynamic { |
27 self::A a = new self::A::•(87); | 27 self::A a = new self::A::•(87); |
28 self::B b = new self::B::•(117); | 28 self::B b = new self::B::•(117); |
29 a.method(); | 29 a.method(); |
30 b.method(); | 30 b.method(); |
31 } | 31 } |
OLD | NEW |