blob: 7f2c062b63a211c1af0aabd8d829e97cbd968892 [file] [log] [blame]
library /*isNonNullableByDefault*/;
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(lowered final self::Class #this) → core::int
return 42;
static method ClassExtension|get#method(lowered final self::Class #this) → () → core::int
return () core::int => self::ClassExtension|method(#this);
static method Extension|method(lowered final dynamic #this) → core::int
return 87;
static method Extension|get#method(lowered 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{dynamic}.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::==}{(core::Object) core::bool} actual)) {
throw "Mismatch: expected=${expected}, actual=${actual}";
}
}