cda4f284b0
Change-Id: Ia9ab202e157102c22b2705d13582d3529288f81e Reviewed-on: https://dart-review.googlesource.com/8502 Commit-Queue: Peter von der Ahé <ahe@google.com> Reviewed-by: Paul Berry <paulberry@google.com> Reviewed-by: Aske Simon Christensen <askesc@google.com>
32 lines
826 B
Plaintext
32 lines
826 B
Plaintext
library;
|
|
import self as self;
|
|
import "dart:core" as core;
|
|
|
|
class A extends core::Object {
|
|
final field core::int x;
|
|
final field core::int y;
|
|
constructor •(core::int y) → void
|
|
: self::A::y = y, self::A::x = 42, super core::Object::•()
|
|
;
|
|
method method() → dynamic {
|
|
core::print("A.method x: ${this.{self::A::x}} y: ${this.{self::A::y}}");
|
|
core::print(this);
|
|
core::print(this.{core::Object::runtimeType});
|
|
}
|
|
}
|
|
class B extends self::A {
|
|
constructor •(dynamic x) → void
|
|
: super self::A::•(x)
|
|
;
|
|
method method() → dynamic {
|
|
core::print("B.method x: ${this.{self::A::x}} y: ${this.{self::A::y}}");
|
|
super.{self::A::method}();
|
|
}
|
|
}
|
|
static method main() → dynamic {
|
|
self::A a = new self::A::•(87);
|
|
self::B b = new self::B::•(117);
|
|
a.method();
|
|
b.method();
|
|
}
|