blob: 95ddf7a0bcff3be6811150d91b880f9830eddc4b [file] [log] [blame]
library;
import self as self;
import "dart:core" as core;
class Class extends core::Object {
synthetic constructor •() self::Class*
: super core::Object::•()
;
method noSuchMethod(core::Invocation* i) dynamic
return 123;
}
extension ClassExtension on self::Class* {
method method = self::ClassExtension|method;
tearoff method = self::ClassExtension|get#method;
}
extension Extension on dynamic {
method method = self::Extension|method;
tearoff method = self::Extension|get#method;
}
static method ClassExtension|method(final self::Class* #this) → core::int*
return 42;
static method ClassExtension|get#method(final self::Class* #this) → () →* core::int*
return () core::int* => self::ClassExtension|method(#this);
static method Extension|method(final dynamic #this) → core::int*
return 87;
static method Extension|get#method(final dynamic #this) → () →* core::int*
return () core::int* => self::Extension|method(#this);
static method main() dynamic {
dynamic c0 = new self::Class::•();
core::Object* c1 = new self::Class::•();
self::Class* c2 = new self::Class::•();
self::expect(123, c0.method());
self::expect(87, self::Extension|method(c1));
self::expect(42, self::ClassExtension|method(c2));
}
static method expect(dynamic expected, dynamic actual) dynamic {
if(!expected.{core::Object::==}(actual)) {
throw "Mismatch: expected=${expected}, actual=${actual}";
}
}