|
| 1 | +library #lib; |
| 2 | +import self as self; |
| 3 | +import "dart:core" as core; |
| 4 | + |
| 5 | +class DefaultEq extends core::Object /*hasConstConstructor*/ { |
| 6 | + |
| 7 | + [@vm.inferred-type.metadata=dart.core::_Smi] |
| 8 | + [@vm.procedure-attributes.metadata=methodOrSetterCalledDynamically:false,getterCalledDynamically:false,hasThisUses:false,hasNonThisUses:false,hasTearOffUses:false,getterSelectorId:1] |
| 9 | + [@vm.unboxing-info.metadata=()->i] |
| 10 | + final field core::int i; |
| 11 | + |
| 12 | + [@vm.unboxing-info.metadata=(i)->b] |
| 13 | + const constructor •([@vm.inferred-arg-type.metadata=dart.core::_Smi] core::int i) → self::DefaultEq |
| 14 | + : self::DefaultEq::i = i, super core::Object::•() |
| 15 | + ; |
| 16 | + |
| 17 | + [@vm.inferred-return-type.metadata=!] |
| 18 | + [@vm.procedure-attributes.metadata=methodOrSetterCalledDynamically:false,getterCalledDynamically:false,hasThisUses:false,hasTearOffUses:false,methodOrSetterSelectorId:2,getterSelectorId:3] |
| 19 | + [@vm.unboxing-info.metadata=[!regcc]] |
| 20 | + method toString() → core::String |
| 21 | + return "DefaultEq(i=${[@vm.direct-call.metadata=#lib::DefaultEq.i] this.{self::DefaultEq::i}{core::int}})"; |
| 22 | +} |
| 23 | +class OverriddenEq extends core::Object /*hasConstConstructor*/ { |
| 24 | + |
| 25 | + [@vm.inferred-type.metadata=dart.core::_Smi] |
| 26 | + [@vm.procedure-attributes.metadata=methodOrSetterCalledDynamically:false,getterCalledDynamically:false,hasThisUses:false,hasNonThisUses:false,hasTearOffUses:false,getterSelectorId:4] |
| 27 | + [@vm.unboxing-info.metadata=()->i] |
| 28 | + final field core::int i; |
| 29 | + |
| 30 | + [@vm.unboxing-info.metadata=(i)->b] |
| 31 | + const constructor •([@vm.inferred-arg-type.metadata=dart.core::_Smi] core::int i) → self::OverriddenEq |
| 32 | + : self::OverriddenEq::i = i, super core::Object::•() |
| 33 | + ; |
| 34 | + |
| 35 | + [@vm.inferred-return-type.metadata=dart.core::bool] |
| 36 | + [@vm.procedure-attributes.metadata=methodOrSetterCalledDynamically:false,getterCalledDynamically:false,hasThisUses:false,hasTearOffUses:false,methodOrSetterSelectorId:5] |
| 37 | + [@vm.unboxing-info.metadata=[!regcc]] |
| 38 | + operator ==(core::Object other) → core::bool { |
| 39 | + return true; |
| 40 | + } |
| 41 | + |
| 42 | + [@vm.inferred-return-type.metadata=!] |
| 43 | + [@vm.procedure-attributes.metadata=methodOrSetterCalledDynamically:false,getterCalledDynamically:false,hasThisUses:false,hasTearOffUses:false,methodOrSetterSelectorId:2,getterSelectorId:3] |
| 44 | + [@vm.unboxing-info.metadata=[!regcc]] |
| 45 | + method toString() → core::String |
| 46 | + return "OverriddenEq(i=${[@vm.direct-call.metadata=#lib::OverriddenEq.i] this.{self::OverriddenEq::i}{core::int}})"; |
| 47 | +} |
| 48 | + |
| 49 | +[@vm.inferred-return-type.metadata=dart.core::Null? (value: null)] |
| 50 | +static method testStringLiteral() → void { |
| 51 | + core::print(#C1); |
| 52 | +} |
| 53 | + |
| 54 | +[@vm.inferred-return-type.metadata=dart.core::Null? (value: null)] |
| 55 | +static method testStringConstant() → void { |
| 56 | + core::print(#C2); |
| 57 | +} |
| 58 | + |
| 59 | +[@vm.inferred-return-type.metadata=dart.core::Null? (value: null)] |
| 60 | +static method testIntLiteral() → void { |
| 61 | + core::print(#C3); |
| 62 | +} |
| 63 | + |
| 64 | +[@vm.inferred-return-type.metadata=dart.core::Null? (value: null)] |
| 65 | +static method testIntConstant() → void { |
| 66 | + core::print(#C4); |
| 67 | +} |
| 68 | + |
| 69 | +[@vm.inferred-return-type.metadata=dart.core::Null? (value: null)] |
| 70 | +static method testDefaultEq1() → void { |
| 71 | + core::print(#C6); |
| 72 | +} |
| 73 | + |
| 74 | +[@vm.inferred-return-type.metadata=dart.core::Null? (value: null)] |
| 75 | +static method testDefaultEq2() → void { |
| 76 | + throw "Attempt to execute code removed by Dart AOT compiler (TFA)"; |
| 77 | +} |
| 78 | + |
| 79 | +[@vm.inferred-return-type.metadata=dart.core::Null? (value: null)] |
| 80 | +static method testOverriddenEq1([@vm.inferred-arg-type.metadata=#lib::OverriddenEq] self::OverriddenEq c) → void { |
| 81 | + core::print(c); |
| 82 | +} |
| 83 | + |
| 84 | +[@vm.inferred-return-type.metadata=dart.core::Null? (value: null)] |
| 85 | +static method testOverriddenEq2([@vm.inferred-arg-type.metadata=#lib::OverriddenEq] self::OverriddenEq c) → void { |
| 86 | + core::print(c); |
| 87 | +} |
| 88 | + |
| 89 | +[@vm.inferred-return-type.metadata=dart.core::bool] |
| 90 | +static get runtimeTrue() → core::bool |
| 91 | + return [@vm.direct-call.metadata=dart.core::_IntegerImplementation.==] [@vm.inferred-type.metadata=dart.core::bool (skip check)] [@vm.inferred-type.metadata=int] core::int::parse("1") =={core::num::==}{(core::Object) → core::bool} 1; |
| 92 | + |
| 93 | +[@vm.inferred-return-type.metadata=dart.core::Null? (value: null)] |
| 94 | +static method main() → void { |
| 95 | + final core::String s1 = [@vm.inferred-type.metadata=dart.core::bool] self::runtimeTrue ?{core::String} "foo" : "bar"; |
| 96 | + if([@vm.inferred-type.metadata=dart.core::bool (receiver not int)] s1 =={core::String::==}{(core::Object) → core::bool} "foo") { |
| 97 | + self::testStringLiteral(); |
| 98 | + } |
| 99 | + final core::String s2 = [@vm.inferred-type.metadata=dart.core::bool] self::runtimeTrue ?{core::String} "1234" : "asdf"; |
| 100 | + if([@vm.inferred-type.metadata=dart.core::bool (receiver not int)] s2 =={core::String::==}{(core::Object) → core::bool} #C2) { |
| 101 | + self::testStringConstant(); |
| 102 | + } |
| 103 | + final core::int i1 = [@vm.inferred-type.metadata=dart.core::bool] self::runtimeTrue ?{core::int} 123 : 456; |
| 104 | + if([@vm.direct-call.metadata=dart.core::_IntegerImplementation.==] [@vm.inferred-type.metadata=dart.core::bool (skip check)] i1 =={core::num::==}{(core::Object) → core::bool} 123) { |
| 105 | + self::testIntLiteral(); |
| 106 | + } |
| 107 | + final core::int i2 = [@vm.inferred-type.metadata=dart.core::bool] self::runtimeTrue ?{core::int} 456 : 789; |
| 108 | + if([@vm.direct-call.metadata=dart.core::_IntegerImplementation.==] [@vm.inferred-type.metadata=dart.core::bool (skip check)] i2 =={core::num::==}{(core::Object) → core::bool} #C4) { |
| 109 | + self::testIntConstant(); |
| 110 | + } |
| 111 | + final self::DefaultEq c1 = [@vm.inferred-type.metadata=dart.core::bool] self::runtimeTrue ?{self::DefaultEq} new self::DefaultEq::•(1) : new self::DefaultEq::•(2); |
| 112 | + if([@vm.direct-call.metadata=dart.core::Object.==] [@vm.inferred-type.metadata=dart.core::bool (skip check) (receiver not int)] c1 =={core::Object::==}{(core::Object) → core::bool} #C6) { |
| 113 | + self::testDefaultEq1(); |
| 114 | + } |
| 115 | + if([@vm.direct-call.metadata=dart.core::Object.==] [@vm.inferred-type.metadata=dart.core::bool (skip check) (receiver not int)] c1 =={core::Object::==}{(core::Object) → core::bool} #C2) { |
| 116 | + self::testDefaultEq2(); |
| 117 | + } |
| 118 | + final self::OverriddenEq c2 = [@vm.inferred-type.metadata=dart.core::bool] self::runtimeTrue ?{self::OverriddenEq} new self::OverriddenEq::•(1) : new self::OverriddenEq::•(2); |
| 119 | + if([@vm.direct-call.metadata=#lib::OverriddenEq.==] [@vm.inferred-type.metadata=dart.core::bool (skip check) (receiver not int)] c2 =={self::OverriddenEq::==}{(core::Object) → core::bool} #C7) { |
| 120 | + self::testOverriddenEq1(c2); |
| 121 | + } |
| 122 | + if([@vm.direct-call.metadata=#lib::OverriddenEq.==] [@vm.inferred-type.metadata=dart.core::bool (skip check) (receiver not int)] c2 =={self::OverriddenEq::==}{(core::Object) → core::bool} #C2) { |
| 123 | + self::testOverriddenEq2(c2); |
| 124 | + } |
| 125 | +} |
| 126 | +constants { |
| 127 | + #C1 = "foo" |
| 128 | + #C2 = "1234" |
| 129 | + #C3 = 123 |
| 130 | + #C4 = 456 |
| 131 | + #C5 = 1 |
| 132 | + #C6 = self::DefaultEq {i:#C5} |
| 133 | + #C7 = self::OverriddenEq {i:#C5} |
| 134 | +} |
0 commit comments