library; import self as self; import "dart:core" as core; class Class1 extends core::Object { field core::int* field; constructor •(core::int* field) → self::Class1* : self::Class1::field = field, super core::Object::•() ; method toString() → core::String* return "Class1(${this.{self::Class1::field}})"; 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 noSuchMethod(core::Invocation* invocation) → dynamic; -> core::Object::noSuchMethod abstract member-signature get runtimeType() → core::Type*; -> core::Object::runtimeType } class Class2 extends core::Object { field core::int* field; constructor •(core::int* field) → self::Class2* : self::Class2::field = field, super core::Object::•() ; method toString() → core::String* return "Class2(${this.{self::Class2::field}})"; 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 noSuchMethod(core::Invocation* invocation) → dynamic; -> core::Object::noSuchMethod abstract member-signature get runtimeType() → core::Type*; -> core::Object::runtimeType } extension Extension1 on self::Class1* { method method = self::Extension1|method; tearoff method = self::Extension1|get#method; method genericMethod = self::Extension1|genericMethod; tearoff genericMethod = self::Extension1|get#genericMethod; get property = self::Extension1|get#property; set property = self::Extension1|set#property; } extension Extension2 on self::Class2* { method method = self::Extension2|method; tearoff method = self::Extension2|get#method; method genericMethod = self::Extension2|genericMethod; tearoff genericMethod = self::Extension2|get#genericMethod; get property = self::Extension2|get#property; set property = self::Extension2|set#property; } static method Extension1|method(lowered final self::Class1* #this) → core::int* { core::print("Extension1.method on ${#this}"); return #this.{self::Class1::field}; } static method Extension1|get#method(lowered final self::Class1* #this) → () →* core::int* return () → core::int* => self::Extension1|method(#this); static method Extension1|genericMethod(lowered final self::Class1* #this, self::Extension1|genericMethod::T* t) → core::int* { core::print("Extension1.genericMethod<${self::Extension1|genericMethod::T*}>(${t}) on ${#this}"); return #this.{self::Class1::field}.{core::num::+}(t) as{TypeError} core::int*; } static method Extension1|get#genericMethod(lowered final self::Class1* #this) → (T*) →* core::int* return (T* t) → core::int* => self::Extension1|genericMethod(#this, t); static method Extension1|get#property(lowered final self::Class1* #this) → core::int* { core::print("Extension1.property get on ${#this}"); return #this.{self::Class1::field}; } static method Extension1|set#property(lowered final self::Class1* #this, core::int* value) → void { #this.{self::Class1::field} = value; core::print("Extension1.property set(${value}) on ${#this}"); value = value.{core::num::+}(1); } static method Extension2|method(lowered final self::Class2* #this) → core::int* { core::print("Extension2.method on ${#this}"); return #this.{self::Class2::field}.{core::num::+}(3); } static method Extension2|get#method(lowered final self::Class2* #this) → () →* core::int* return () → core::int* => self::Extension2|method(#this); static method Extension2|genericMethod(lowered final self::Class2* #this, self::Extension2|genericMethod::T* t) → core::int* { core::print("Extension2.genericMethod<${self::Extension2|genericMethod::T*}>(${t}) on ${#this}"); return #this.{self::Class2::field}.{core::num::+}(t).{core::num::+}(4) as{TypeError} core::int*; } static method Extension2|get#genericMethod(lowered final self::Class2* #this) → (T*) →* core::int* return (T* t) → core::int* => self::Extension2|genericMethod(#this, t); static method Extension2|get#property(lowered final self::Class2* #this) → core::int* { core::print("Extension2.property get on ${#this}"); return #this.{self::Class2::field}.{core::num::+}(5); } static method Extension2|set#property(lowered final self::Class2* #this, core::int* value) → void { core::print("Extension2.property set(${value}) on ${#this}"); value = value.{core::num::+}(1); #this.{self::Class2::field} = value; } static method main() → dynamic { self::testExtension1(); self::testExtension2(); } static method testExtension1() → dynamic { self::Class1* c0 = new self::Class1::•(0); self::Class1* c1 = new self::Class1::•(1); self::expect(0, self::Extension1|method(c0)); self::expect(1, self::Extension1|method(c1)); self::expect(1, let final self::Class1* #t1 = c1 in #t1.{self::Class1::==}(null) ?{core::int*} null : self::Extension1|method(#t1)); self::expect(42, self::Extension1|genericMethod(c0, 42)); self::expect(43, self::Extension1|genericMethod(c0, 43)); self::expect(88, self::Extension1|genericMethod(c1, 87)); self::expect(89, self::Extension1|genericMethod(c1, 88)); self::expect(0, self::Extension1|get#property(c0)); self::expect(0, let final self::Class1* #t2 = c0 in #t2.{self::Class1::==}(null) ?{core::int*} null : self::Extension1|get#property(#t2)); self::expect(42, let final core::int* #t3 = 42 in let final void #t4 = self::Extension1|set#property(c0, #t3) in #t3); self::expect(1, self::Extension1|get#property(c1)); self::expect(87, let final core::int* #t5 = 87 in let final void #t6 = self::Extension1|set#property(c0, #t5) in #t5); self::expect(27, let final core::int* #t7 = let final core::int* #t8 = 27 in let final void #t9 = self::Extension1|set#property(c1, #t8) in #t8 in let final void #t10 = self::Extension1|set#property(c0, #t7) in #t7); self::expect(37, let final core::int* #t11 = let final core::int* #t12 = 37 in let final void #t13 = self::Extension1|set#property(c0, #t12) in #t12 in let final void #t14 = self::Extension1|set#property(c1, #t11) in #t11); self::expect(77, let final core::int* #t15 = let final core::int* #t16 = let final core::int* #t17 = 77 in let final void #t18 = self::Extension1|set#property(c1, #t17) in #t17 in let final void #t19 = self::Extension1|set#property(c0, #t16) in #t16 in let final void #t20 = self::Extension1|set#property(c1, #t15) in #t15); self::expect(67, let final core::int* #t21 = let final core::int* #t22 = let final core::int* #t23 = 67 in let final void #t24 = self::Extension1|set#property(c0, #t23) in #t23 in let final void #t25 = self::Extension1|set#property(c1, #t22) in #t22 in let final void #t26 = self::Extension1|set#property(c0, #t21) in #t21); } static method testExtension2() → dynamic { self::Class2* c0 = new self::Class2::•(0); self::Class2* c1 = new self::Class2::•(1); self::expect(3, self::Extension2|method(c0)); self::expect(3, let final self::Class2* #t27 = c0 in #t27.{self::Class2::==}(null) ?{core::int*} null : self::Extension2|method(#t27)); self::expect(4, self::Extension2|method(c1)); self::expect(46, self::Extension2|genericMethod(c0, 42)); self::expect(47, self::Extension2|genericMethod(c0, 43)); self::expect(92, self::Extension2|genericMethod(c1, 87)); self::expect(93, self::Extension2|genericMethod(c1, 88)); self::expect(5, self::Extension2|get#property(c0)); self::expect(5, let final self::Class2* #t28 = c0 in #t28.{self::Class2::==}(null) ?{core::int*} null : self::Extension2|get#property(#t28)); self::expect(42, let final core::int* #t29 = 42 in let final void #t30 = self::Extension2|set#property(c0, #t29) in #t29); self::expect(48, self::Extension2|get#property(c0)); self::expect(6, self::Extension2|get#property(c1)); self::expect(43, let final core::int* #t31 = 43 in let final void #t32 = self::Extension2|set#property(c1, #t31) in #t31); self::expect(49, self::Extension2|get#property(c1)); self::expect(49, let final core::int* #t33 = self::Extension2|get#property(c1) in let final void #t34 = self::Extension2|set#property(c0, #t33) in #t33); self::expect(55, let final core::int* #t35 = self::Extension2|get#property(c0) in let final void #t36 = self::Extension2|set#property(c1, #t35) in #t35); self::expect(61, let final core::int* #t37 = let final core::int* #t38 = self::Extension2|get#property(c1) in let final void #t39 = self::Extension2|set#property(c0, #t38) in #t38 in let final void #t40 = self::Extension2|set#property(c1, #t37) in #t37); self::expect(67, let final core::int* #t41 = let final core::int* #t42 = self::Extension2|get#property(c0) in let final void #t43 = self::Extension2|set#property(c1, #t42) in #t42 in let final void #t44 = self::Extension2|set#property(c0, #t41) in #t41); } static method expect(dynamic expected, dynamic actual) → dynamic { if(!expected.{core::Object::==}(actual)) { throw "Mismatch: expected=${expected}, actual=${actual}"; } } Extra constant evaluation status: Evaluated: VariableGet @ org-dartlang-testcase:///instance_access.dart:79:28 -> IntConstant(42) Evaluated: VariableGet @ org-dartlang-testcase:///instance_access.dart:79:28 -> IntConstant(42) Evaluated: VariableGet @ org-dartlang-testcase:///instance_access.dart:81:28 -> IntConstant(87) Evaluated: VariableGet @ org-dartlang-testcase:///instance_access.dart:81:28 -> IntConstant(87) Evaluated: VariableGet @ org-dartlang-testcase:///instance_access.dart:82:42 -> IntConstant(27) Evaluated: VariableGet @ org-dartlang-testcase:///instance_access.dart:82:42 -> IntConstant(27) Evaluated: VariableGet @ org-dartlang-testcase:///instance_access.dart:83:42 -> IntConstant(37) Evaluated: VariableGet @ org-dartlang-testcase:///instance_access.dart:83:42 -> IntConstant(37) Evaluated: VariableGet @ org-dartlang-testcase:///instance_access.dart:84:56 -> IntConstant(77) Evaluated: VariableGet @ org-dartlang-testcase:///instance_access.dart:84:56 -> IntConstant(77) Evaluated: VariableGet @ org-dartlang-testcase:///instance_access.dart:85:56 -> IntConstant(67) Evaluated: VariableGet @ org-dartlang-testcase:///instance_access.dart:85:56 -> IntConstant(67) Evaluated: VariableGet @ org-dartlang-testcase:///instance_access.dart:100:28 -> IntConstant(42) Evaluated: VariableGet @ org-dartlang-testcase:///instance_access.dart:100:28 -> IntConstant(42) Evaluated: VariableGet @ org-dartlang-testcase:///instance_access.dart:103:28 -> IntConstant(43) Evaluated: VariableGet @ org-dartlang-testcase:///instance_access.dart:103:28 -> IntConstant(43) Extra constant evaluation: evaluated: 325, effectively constant: 16