| library /*isNonNullableByDefault*/; |
| import self as self; |
| import "dart:core" as core; |
| |
| class Class1 extends core::Object /*hasConstConstructor*/ { |
| const constructor •() → self::Class1 |
| : super core::Object::•() |
| ; |
| operator ==(core::Object other) → core::bool { |
| return true; |
| } |
| } |
| class Class2 extends core::Object /*hasConstConstructor*/ { |
| const constructor •() → self::Class2 |
| : super core::Object::•() |
| ; |
| operator ==(core::Object other) → core::bool { |
| return false; |
| } |
| } |
| static const field self::Class1 c1 = #C1; |
| static const field self::Class2 c2 = #C2; |
| static method test1(dynamic o) → dynamic { |
| #L1: |
| { |
| final synthesized dynamic #0#0 = o; |
| if(#C1 =={self::Class1::==}{(core::Object) → core::bool} #0#0) { |
| { |
| return true; |
| } |
| } |
| else { |
| { |
| return false; |
| } |
| } |
| } |
| } |
| static method test2(dynamic o) → dynamic { |
| #L2: |
| { |
| final synthesized dynamic #0#0 = o; |
| if(#C2 =={self::Class2::==}{(core::Object) → core::bool} #0#0) { |
| { |
| return true; |
| } |
| } |
| else { |
| { |
| return false; |
| } |
| } |
| } |
| } |
| static method main() → dynamic { |
| self::expect(true, self::test1(#C1)); |
| self::expect(true, self::test1(new self::Class1::•())); |
| self::expect(true, self::test1(0)); |
| self::expect(false, self::test1(null)); |
| self::expect(false, self::test2(#C2)); |
| self::expect(false, self::test2(new self::Class2::•())); |
| self::expect(false, self::test2(0)); |
| self::expect(false, self::test2(null)); |
| } |
| static method expect(dynamic expected, dynamic actual) → dynamic { |
| if(!(expected =={core::Object::==}{(core::Object) → core::bool} actual)) { |
| throw "Expected ${expected}, actual ${actual}"; |
| } |
| } |
| |
| constants { |
| #C1 = self::Class1 {} |
| #C2 = self::Class2 {} |
| } |
| |
| |
| Constructor coverage from constants: |
| org-dartlang-testcase:///user_defined_equals.dart: |
| - Class1. (from org-dartlang-testcase:///user_defined_equals.dart:6:9) |
| - Object. (from org-dartlang-sdk:///sdk/lib/core/object.dart) |
| - Class2. (from org-dartlang-testcase:///user_defined_equals.dart:25:9) |