blob: ce8e8ef982307b12c6a75ee6ec06b6f72416bd99 [file] [log] [blame]
library;
import self as self;
import "dart:core" as core;
class Class extends core::Object {
field core::int* field = null;
synthetic constructor •() self::Class*
: super core::Object::•()
;
abstract member-signature get _identityHashCode() core::int*; -> core::Object::_identityHashCode
abstract member-signature method _instanceOf(dynamic instantiatorTypeArguments, dynamic functionTypeArguments, dynamic type) core::bool*; -> core::Object::_instanceOf
abstract member-signature method _simpleInstanceOf(dynamic type) core::bool*; -> core::Object::_simpleInstanceOf
abstract member-signature method _simpleInstanceOfTrue(dynamic type) core::bool*; -> core::Object::_simpleInstanceOfTrue
abstract member-signature method _simpleInstanceOfFalse(dynamic type) core::bool*; -> core::Object::_simpleInstanceOfFalse
abstract member-signature operator ==(dynamic other) core::bool*; -> core::Object::==
abstract member-signature get hashCode() core::int*; -> core::Object::hashCode
abstract member-signature method toString() core::String*; -> core::Object::toString
abstract member-signature method noSuchMethod(core::Invocation* invocation) dynamic; -> core::Object::noSuchMethod
abstract member-signature get runtimeType() core::Type*; -> core::Object::runtimeType
}
class GenericClass<T extends core::Object* = dynamic> extends core::Object {
synthetic constructor •() self::GenericClass<self::GenericClass::T*>*
: super core::Object::•()
;
abstract member-signature get _identityHashCode() core::int*; -> core::Object::_identityHashCode
abstract member-signature method _instanceOf(dynamic instantiatorTypeArguments, dynamic functionTypeArguments, dynamic type) core::bool*; -> core::Object::_instanceOf
abstract member-signature method _simpleInstanceOf(dynamic type) core::bool*; -> core::Object::_simpleInstanceOf
abstract member-signature method _simpleInstanceOfTrue(dynamic type) core::bool*; -> core::Object::_simpleInstanceOfTrue
abstract member-signature method _simpleInstanceOfFalse(dynamic type) core::bool*; -> core::Object::_simpleInstanceOfFalse
abstract member-signature operator ==(dynamic other) core::bool*; -> core::Object::==
abstract member-signature get hashCode() core::int*; -> core::Object::hashCode
abstract member-signature method toString() core::String*; -> core::Object::toString
abstract member-signature method noSuchMethod(core::Invocation* invocation) dynamic; -> core::Object::noSuchMethod
abstract member-signature get runtimeType() core::Type*; -> core::Object::runtimeType
}
extension Extension on self::Class* {
get simpleSetter = self::Extension|get#simpleSetter;
get mutatingSetter = self::Extension|get#mutatingSetter;
get setterWithReturn = self::Extension|get#setterWithReturn;
get setterWithClosure = self::Extension|get#setterWithClosure;
method testInternal = self::Extension|testInternal;
tearoff testInternal = self::Extension|get#testInternal;
set simpleSetter = self::Extension|set#simpleSetter;
set mutatingSetter = self::Extension|set#mutatingSetter;
set setterWithReturn = self::Extension|set#setterWithReturn;
set setterWithClosure = self::Extension|set#setterWithClosure;
}
extension GenericExtension<T extends core::Object* = dynamic> on self::GenericClass<T*>* {
set setter = self::GenericExtension|set#setter;
}
static method Extension|get#simpleSetter(lowered final self::Class* #this) → core::int*
return #this.{self::Class::field};
static method Extension|set#simpleSetter(lowered final self::Class* #this, core::int* value) → void {
#this.{self::Class::field} = value;
}
static method Extension|get#mutatingSetter(lowered final self::Class* #this) → core::int*
return #this.{self::Class::field};
static method Extension|set#mutatingSetter(lowered final self::Class* #this, core::int* value) → void {
value = value.{core::num::+}(1);
#this.{self::Class::field} = value;
}
static method Extension|get#setterWithReturn(lowered final self::Class* #this) → core::int*
return #this.{self::Class::field};
static method Extension|set#setterWithReturn(lowered final self::Class* #this, core::int* value) → void {
if(value.{core::num::<}(0)) {
#this.{self::Class::field} = value.{core::int::unary-}();
return;
}
#this.{self::Class::field} = value;
}
static method Extension|get#setterWithClosure(lowered final self::Class* #this) → core::int*
return #this.{self::Class::field};
static method Extension|set#setterWithClosure(lowered final self::Class* #this, core::int* value) → void {
function abs(dynamic value) dynamic {
return value.<(0) as{TypeError,ForDynamic} core::bool* ?{dynamic} value.unary-() : value;
}
#this.{self::Class::field} = abs.call(value) as{TypeError,ForDynamic} core::int*;
}
static method Extension|testInternal(lowered final self::Class* #this) → dynamic {
self::expect(null, #this.{self::Class::field});
self::Extension|set#simpleSetter(#this, 0);
self::expect(0, #this.{self::Class::field});
self::expect(1, let final core::int* #t1 = 1 in let final void #t2 = self::Extension|set#simpleSetter(#this, #t1) in #t1);
self::Extension|set#mutatingSetter(#this, 0);
self::expect(1, #this.{self::Class::field});
self::expect(2, let final core::int* #t3 = 2 in let final void #t4 = self::Extension|set#mutatingSetter(#this, #t3) in #t3);
self::expect(3, #this.{self::Class::field});
self::Extension|set#setterWithReturn(#this, 1);
self::expect(1, #this.{self::Class::field});
self::Extension|set#setterWithReturn(#this, 2.{core::int::unary-}());
self::expect(2, #this.{self::Class::field});
self::expect(3, let final core::int* #t5 = 3 in let final void #t6 = self::Extension|set#setterWithReturn(#this, #t5) in #t5);
self::expect(3, #this.{self::Class::field});
self::expect(4.{core::int::unary-}(), let final core::int* #t7 = 4.{core::int::unary-}() in let final void #t8 = self::Extension|set#setterWithReturn(#this, #t7) in #t7);
self::expect(4, #this.{self::Class::field});
self::Extension|set#setterWithClosure(#this, 1);
self::expect(1, #this.{self::Class::field});
self::Extension|set#setterWithClosure(#this, 2.{core::int::unary-}());
self::expect(2, #this.{self::Class::field});
self::expect(3, let final core::int* #t9 = 3 in let final void #t10 = self::Extension|set#setterWithClosure(#this, #t9) in #t9);
self::expect(3, #this.{self::Class::field});
self::expect(4.{core::int::unary-}(), let final core::int* #t11 = 4.{core::int::unary-}() in let final void #t12 = self::Extension|set#setterWithClosure(#this, #t11) in #t11);
self::expect(4, #this.{self::Class::field});
}
static method Extension|get#testInternal(lowered final self::Class* #this) → () →* dynamic
return () dynamic => self::Extension|testInternal(#this);
static method GenericExtension|set#setter<T extends core::Object* = dynamic>(lowered final self::GenericClass<self::GenericExtension|set#setter::T*>* #this, self::GenericExtension|set#setter::T* value) → void {}
static method main() dynamic {
self::Class* c = new self::Class::•();
self::expect(null, c.{self::Class::field});
self::Extension|set#simpleSetter(c, 0);
self::expect(0, c.{self::Class::field});
self::expect(1, let final core::int* #t13 = 1 in let final void #t14 = self::Extension|set#simpleSetter(c, #t13) in #t13);
self::Extension|set#simpleSetter(c, 2);
self::expect(2, c.{self::Class::field});
self::expect(3, let final self::Class* #t15 = c in let final core::int* #t16 = 3 in let final void #t17 = self::Extension|set#simpleSetter(#t15, #t16) in #t16);
self::Extension|set#mutatingSetter(c, 0);
self::expect(1, c.{self::Class::field});
self::expect(2, let final core::int* #t18 = 2 in let final void #t19 = self::Extension|set#mutatingSetter(c, #t18) in #t18);
self::expect(3, c.{self::Class::field});
self::Extension|set#mutatingSetter(c, 4);
self::expect(5, c.{self::Class::field});
self::expect(6, let final self::Class* #t20 = c in let final core::int* #t21 = 6 in let final void #t22 = self::Extension|set#mutatingSetter(#t20, #t21) in #t21);
self::expect(7, c.{self::Class::field});
self::Extension|set#setterWithReturn(c, 1);
self::expect(1, c.{self::Class::field});
self::Extension|set#setterWithReturn(c, 2.{core::int::unary-}());
self::expect(2, c.{self::Class::field});
self::expect(3, let final core::int* #t23 = 3 in let final void #t24 = self::Extension|set#setterWithReturn(c, #t23) in #t23);
self::expect(3, c.{self::Class::field});
self::expect(4.{core::int::unary-}(), let final core::int* #t25 = 4.{core::int::unary-}() in let final void #t26 = self::Extension|set#setterWithReturn(c, #t25) in #t25);
self::expect(4, c.{self::Class::field});
self::Extension|set#setterWithReturn(c, 5);
self::expect(5, c.{self::Class::field});
self::Extension|set#setterWithReturn(c, 6.{core::int::unary-}());
self::expect(6, c.{self::Class::field});
self::expect(7, let final self::Class* #t27 = c in let final core::int* #t28 = 7 in let final void #t29 = self::Extension|set#setterWithReturn(#t27, #t28) in #t28);
self::expect(7, c.{self::Class::field});
self::expect(8.{core::int::unary-}(), let final self::Class* #t30 = c in let final core::int* #t31 = 8.{core::int::unary-}() in let final void #t32 = self::Extension|set#setterWithReturn(#t30, #t31) in #t31);
self::expect(8, c.{self::Class::field});
self::Extension|set#setterWithClosure(c, 1);
self::expect(1, c.{self::Class::field});
self::Extension|set#setterWithClosure(c, 2.{core::int::unary-}());
self::expect(2, c.{self::Class::field});
self::expect(3, let final core::int* #t33 = 3 in let final void #t34 = self::Extension|set#setterWithClosure(c, #t33) in #t33);
self::expect(3, c.{self::Class::field});
self::expect(4.{core::int::unary-}(), let final core::int* #t35 = 4.{core::int::unary-}() in let final void #t36 = self::Extension|set#setterWithClosure(c, #t35) in #t35);
self::expect(4, c.{self::Class::field});
self::Extension|set#setterWithClosure(c, 5);
self::expect(5, c.{self::Class::field});
self::Extension|set#setterWithClosure(c, 6.{core::int::unary-}());
self::expect(6, c.{self::Class::field});
self::expect(7, let final self::Class* #t37 = c in let final core::int* #t38 = 7 in let final void #t39 = self::Extension|set#setterWithClosure(#t37, #t38) in #t38);
self::expect(7, c.{self::Class::field});
self::expect(8.{core::int::unary-}(), let final self::Class* #t40 = c in let final core::int* #t41 = 8.{core::int::unary-}() in let final void #t42 = self::Extension|set#setterWithClosure(#t40, #t41) in #t41);
self::expect(8, c.{self::Class::field});
self::Extension|set#simpleSetter(c, 0);
self::expect(0, let final self::Class* #t43 = c in #t43.{self::Class::==}(null) ?{core::int*} null : #t43.{self::Class::field});
self::expect(1, let final self::Class* #t44 = c in #t44.{self::Class::==}(null) ?{core::int*} null : let final core::int* #t45 = 1 in let final void #t46 = self::Extension|set#simpleSetter(#t44, #t45) in #t45);
self::Extension|set#simpleSetter(c, 2);
self::expect(2, let final self::Class* #t47 = c in #t47.{self::Class::==}(null) ?{core::int*} null : #t47.{self::Class::field});
self::expect(3, let final self::Class* #t48 = c in let final core::int* #t49 = 3 in let final void #t50 = self::Extension|set#simpleSetter(#t48, #t49) in #t49);
self::Extension|set#mutatingSetter(c, 0);
self::expect(1, let final self::Class* #t51 = c in #t51.{self::Class::==}(null) ?{core::int*} null : #t51.{self::Class::field});
self::expect(2, let final self::Class* #t52 = c in #t52.{self::Class::==}(null) ?{core::int*} null : let final core::int* #t53 = 2 in let final void #t54 = self::Extension|set#mutatingSetter(#t52, #t53) in #t53);
self::expect(3, let final self::Class* #t55 = c in #t55.{self::Class::==}(null) ?{core::int*} null : #t55.{self::Class::field});
self::Extension|set#mutatingSetter(c, 4);
self::expect(5, let final self::Class* #t56 = c in #t56.{self::Class::==}(null) ?{core::int*} null : #t56.{self::Class::field});
self::expect(6, let final self::Class* #t57 = c in let final core::int* #t58 = 6 in let final void #t59 = self::Extension|set#mutatingSetter(#t57, #t58) in #t58);
self::expect(7, let final self::Class* #t60 = c in #t60.{self::Class::==}(null) ?{core::int*} null : #t60.{self::Class::field});
let final self::Class* #t61 = c in #t61.{self::Class::==}(null) ?{core::int*} null : self::Extension|set#setterWithReturn(#t61, 1);
self::expect(1, let final self::Class* #t62 = c in #t62.{self::Class::==}(null) ?{core::int*} null : #t62.{self::Class::field});
let final self::Class* #t63 = c in #t63.{self::Class::==}(null) ?{core::int*} null : self::Extension|set#setterWithReturn(#t63, 2.{core::int::unary-}());
self::expect(2, let final self::Class* #t64 = c in #t64.{self::Class::==}(null) ?{core::int*} null : #t64.{self::Class::field});
self::expect(3, let final self::Class* #t65 = c in #t65.{self::Class::==}(null) ?{core::int*} null : let final core::int* #t66 = 3 in let final void #t67 = self::Extension|set#setterWithReturn(#t65, #t66) in #t66);
self::expect(3, let final self::Class* #t68 = c in #t68.{self::Class::==}(null) ?{core::int*} null : #t68.{self::Class::field});
self::expect(4.{core::int::unary-}(), let final self::Class* #t69 = c in #t69.{self::Class::==}(null) ?{core::int*} null : let final core::int* #t70 = 4.{core::int::unary-}() in let final void #t71 = self::Extension|set#setterWithReturn(#t69, #t70) in #t70);
self::expect(4, let final self::Class* #t72 = c in #t72.{self::Class::==}(null) ?{core::int*} null : #t72.{self::Class::field});
self::Extension|set#setterWithReturn(c, 5);
self::expect(5, let final self::Class* #t73 = c in #t73.{self::Class::==}(null) ?{core::int*} null : #t73.{self::Class::field});
self::Extension|set#setterWithReturn(c, 6.{core::int::unary-}());
self::expect(6, let final self::Class* #t74 = c in #t74.{self::Class::==}(null) ?{core::int*} null : #t74.{self::Class::field});
self::expect(7, let final self::Class* #t75 = c in let final core::int* #t76 = 7 in let final void #t77 = self::Extension|set#setterWithReturn(#t75, #t76) in #t76);
self::expect(7, let final self::Class* #t78 = c in #t78.{self::Class::==}(null) ?{core::int*} null : #t78.{self::Class::field});
self::expect(8.{core::int::unary-}(), let final self::Class* #t79 = c in let final core::int* #t80 = 8.{core::int::unary-}() in let final void #t81 = self::Extension|set#setterWithReturn(#t79, #t80) in #t80);
self::expect(8, let final self::Class* #t82 = c in #t82.{self::Class::==}(null) ?{core::int*} null : #t82.{self::Class::field});
let final self::Class* #t83 = c in #t83.{self::Class::==}(null) ?{core::int*} null : self::Extension|set#setterWithClosure(#t83, 1);
self::expect(1, let final self::Class* #t84 = c in #t84.{self::Class::==}(null) ?{core::int*} null : #t84.{self::Class::field});
let final self::Class* #t85 = c in #t85.{self::Class::==}(null) ?{core::int*} null : self::Extension|set#setterWithClosure(#t85, 2.{core::int::unary-}());
self::expect(2, let final self::Class* #t86 = c in #t86.{self::Class::==}(null) ?{core::int*} null : #t86.{self::Class::field});
self::expect(3, let final self::Class* #t87 = c in #t87.{self::Class::==}(null) ?{core::int*} null : let final core::int* #t88 = 3 in let final void #t89 = self::Extension|set#setterWithClosure(#t87, #t88) in #t88);
self::expect(3, let final self::Class* #t90 = c in #t90.{self::Class::==}(null) ?{core::int*} null : #t90.{self::Class::field});
self::expect(4.{core::int::unary-}(), let final self::Class* #t91 = c in #t91.{self::Class::==}(null) ?{core::int*} null : let final core::int* #t92 = 4.{core::int::unary-}() in let final void #t93 = self::Extension|set#setterWithClosure(#t91, #t92) in #t92);
self::expect(4, let final self::Class* #t94 = c in #t94.{self::Class::==}(null) ?{core::int*} null : #t94.{self::Class::field});
self::Extension|set#setterWithClosure(c, 5);
self::expect(5, let final self::Class* #t95 = c in #t95.{self::Class::==}(null) ?{core::int*} null : #t95.{self::Class::field});
self::Extension|set#setterWithClosure(c, 6.{core::int::unary-}());
self::expect(6, let final self::Class* #t96 = c in #t96.{self::Class::==}(null) ?{core::int*} null : #t96.{self::Class::field});
self::expect(7, let final self::Class* #t97 = c in let final core::int* #t98 = 7 in let final void #t99 = self::Extension|set#setterWithClosure(#t97, #t98) in #t98);
self::expect(7, let final self::Class* #t100 = c in #t100.{self::Class::==}(null) ?{core::int*} null : #t100.{self::Class::field});
self::expect(8.{core::int::unary-}(), let final self::Class* #t101 = c in let final core::int* #t102 = 8.{core::int::unary-}() in let final void #t103 = self::Extension|set#setterWithClosure(#t101, #t102) in #t102);
self::expect(8, let final self::Class* #t104 = c in #t104.{self::Class::==}(null) ?{core::int*} null : #t104.{self::Class::field});
c.{self::Class::field} = null;
let final self::Class* #t105 = c in self::Extension|get#simpleSetter(#t105).{core::num::==}(null) ?{core::int*} self::Extension|set#simpleSetter(#t105, 1) : null;
self::expect(1, c.{self::Class::field});
self::expect(1, let final self::Class* #t106 = c in let final core::int* #t107 = self::Extension|get#simpleSetter(#t106) in #t107.{core::num::==}(null) ?{core::int*} let final core::int* #t108 = 2 in let final void #t109 = self::Extension|set#simpleSetter(#t106, #t108) in #t108 : #t107);
c.{self::Class::field} = null;
self::expect(2, let final self::Class* #t110 = c in let final core::int* #t111 = self::Extension|get#simpleSetter(#t110) in #t111.{core::num::==}(null) ?{core::int*} let final core::int* #t112 = 2 in let final void #t113 = self::Extension|set#simpleSetter(#t110, #t112) in #t112 : #t111);
let final self::Class* #t114 = c in #t114.{self::Class::==}(null) ?{Null} null : #t114.{self::Class::field} = null;
let final self::Class* #t115 = c in #t115.{self::Class::==}(null) ?{core::int*} null : self::Extension|get#simpleSetter(#t115).{core::num::==}(null) ?{core::int*} self::Extension|set#simpleSetter(#t115, 1) : null;
self::expect(1, let final self::Class* #t116 = c in #t116.{self::Class::==}(null) ?{core::int*} null : #t116.{self::Class::field});
self::expect(1, let final self::Class* #t117 = c in #t117.{self::Class::==}(null) ?{core::int*} null : let final core::int* #t118 = self::Extension|get#simpleSetter(#t117) in #t118.{core::num::==}(null) ?{core::int*} let final core::int* #t119 = 2 in let final void #t120 = self::Extension|set#simpleSetter(#t117, #t119) in #t119 : #t118);
let final self::Class* #t121 = c in #t121.{self::Class::==}(null) ?{Null} null : #t121.{self::Class::field} = null;
self::expect(2, let final self::Class* #t122 = c in #t122.{self::Class::==}(null) ?{core::int*} null : let final core::int* #t123 = self::Extension|get#simpleSetter(#t122) in #t123.{core::num::==}(null) ?{core::int*} let final core::int* #t124 = 2 in let final void #t125 = self::Extension|set#simpleSetter(#t122, #t124) in #t124 : #t123);
self::Extension|testInternal(new self::Class::•());
self::GenericClass<core::int*>* genericClass = new self::GenericClass::•<core::int*>();
self::expect(1, let final self::GenericClass<core::int*>* #t126 = genericClass in let final core::int* #t127 = 1 in let final void #t128 = self::GenericExtension|set#setter<core::int*>(#t126, #t127) in #t127);
}
static method expect(dynamic expected, dynamic actual) dynamic {
if(!expected.{core::Object::==}(actual)) {
throw "Mismatch: expected=${expected}, actual=${actual}";
}
}