mirror of
https://github.com/dart-lang/sdk
synced 2024-11-02 15:01:30 +00:00
ebb3dea075
R=ahe@google.com, paulberry@google.com, sigmund@google.com BUG= Review-Url: https://codereview.chromium.org/2981783002 .
50 lines
1.2 KiB
Text
50 lines
1.2 KiB
Text
library;
|
|
import self as self;
|
|
import "dart:core" as core;
|
|
|
|
class A extends core::Object {
|
|
field dynamic field = null;
|
|
default constructor •() → void
|
|
: super core::Object::•()
|
|
;
|
|
}
|
|
class B extends core::Object {
|
|
field dynamic field = null;
|
|
default constructor •() → void
|
|
: super core::Object::•()
|
|
;
|
|
}
|
|
class C extends core::Object {
|
|
default constructor •() → void
|
|
: super core::Object::•()
|
|
;
|
|
operator ==(dynamic x) → dynamic
|
|
return false;
|
|
}
|
|
class X extends core::Object implements self::A, self::B {
|
|
field dynamic field = null;
|
|
default constructor •() → void
|
|
: super core::Object::•()
|
|
;
|
|
}
|
|
static method useAsA(self::A object) → void {
|
|
dynamic _ = object.field;
|
|
}
|
|
static method useAsB(self::B object) → void {
|
|
dynamic _ = object.field;
|
|
self::escape(object);
|
|
}
|
|
static method escape(dynamic x) → void {
|
|
x.==(null) ? x = "" : null;
|
|
x.==(null) ? x = 45 : null;
|
|
if(!(x is core::int) && !(x is core::String)) {
|
|
x.field = 45;
|
|
}
|
|
}
|
|
static method main() → dynamic {
|
|
dynamic object = new self::X::•();
|
|
self::useAsA(new self::A::•());
|
|
self::useAsA(object);
|
|
self::useAsB(new self::B::•());
|
|
self::useAsB(object);
|
|
}
|