| library; |
| import self as self; |
| import "dart:core" as core; |
| |
| extension _ on core::int { |
| method method = self::_|method; |
| method tearoff method = self::_|get#method; |
| } |
| static extension-member method _|method(lowered final core::int #this, core::int i) → core::int |
| return #this.{core::num::+}(i){(core::num) → core::int}; |
| static extension-member method _|get#method(lowered final core::int #this) → (core::int) → core::int |
| return (core::int i) → core::int => self::_|method(#this, i); |
| static method method(dynamic d) → dynamic |
| return block { |
| core::int #t1; |
| final synthesized dynamic #0#0 = d; |
| #L1: |
| { |
| { |
| hoisted (core::int) → core::int method; |
| if(#0#0 is core::int) { |
| method = self::_|get#method(#0#0{core::int}); |
| #t1 = method(d{core::int}){(core::int) → core::int}; |
| break #L1; |
| } |
| } |
| { |
| if(true) { |
| #t1 = 0; |
| break #L1; |
| } |
| } |
| } |
| } =>#t1; |
| static method main() → dynamic { |
| self::expect(42, self::method(21)); |
| self::expect(0, self::method("21")); |
| } |
| static method expect(dynamic expected, dynamic actual) → dynamic { |
| if(!(expected =={core::Object::==}{(core::Object) → core::bool} actual)) |
| throw "Expected ${expected}, actual ${actual}"; |
| } |