| library; | |
| import self as self; | |
| import "dart:core" as core; | |
| static method test(dynamic o) → core::int { | |
| { | |
| core::int #t1 = 1.{core::int::unary-}(){() → core::int}; | |
| final synthesized dynamic #0#0 = o; | |
| final const synthesized core::int #0#3 = #C1; | |
| final const synthesized core::int #0#7 = #C2; | |
| final const synthesized core::int #0#10 = #C3; | |
| final const synthesized core::int #0#12 = #C4; | |
| final const synthesized core::int #0#14 = #C5; | |
| #L1: | |
| { | |
| { | |
| hoisted dynamic a; | |
| if(#0#0 is core::List<dynamic> && #0#0{core::List<dynamic>}.{core::List::length}{core::int} =={core::num::==}{(core::Object) → core::bool} #C1 && (let final dynamic #t2 = a = #0#0{core::List<dynamic>}.{core::List::[]}(0){(core::int) → dynamic} in true)) { | |
| { | |
| return a as{TypeError,ForDynamic} core::int; | |
| } | |
| } | |
| } | |
| { | |
| if(#C2 =={core::num::==}{(core::Object) → core::bool} #0#0) { | |
| { | |
| #t1 = 0; | |
| break #L1; | |
| } | |
| } | |
| } | |
| { | |
| if(#C1 =={core::num::==}{(core::Object) → core::bool} #0#0) { | |
| { | |
| return 1; | |
| } | |
| } | |
| } | |
| { | |
| if(#C3 =={core::num::==}{(core::Object) → core::bool} #0#0) { | |
| #t1 = 0; | |
| break #L1; | |
| } | |
| } | |
| { | |
| if(#C4 =={core::num::==}{(core::Object) → core::bool} #0#0) { | |
| { | |
| #t1 = 1; | |
| break #L1; | |
| } | |
| } | |
| } | |
| { | |
| if(#C5 =={core::num::==}{(core::Object) → core::bool} #0#0) { | |
| { | |
| return 4; | |
| } | |
| } | |
| } | |
| { | |
| { | |
| #t1 = 1; | |
| break #L1; | |
| } | |
| } | |
| } | |
| switch(#t1) /* dynamic */ { | |
| #L2: | |
| case #C2: | |
| { | |
| { | |
| return 2; | |
| } | |
| } | |
| #L3: | |
| case #C1: | |
| default: | |
| { | |
| { | |
| return 1.{core::int::unary-}(){() → core::int}; | |
| } | |
| } | |
| } | |
| } | |
| } | |
| static method main() → dynamic { | |
| self::expect(0, self::test(<core::int>[0])); | |
| self::expect(1, self::test(<core::int>[1])); | |
| self::expect(2, self::test(0)); | |
| self::expect(1, self::test(1)); | |
| self::expect(2, self::test(2)); | |
| self::expect(1.{core::int::unary-}(){() → core::int}, self::test(3)); | |
| self::expect(4, self::test(4)); | |
| self::expect(1.{core::int::unary-}(){() → core::int}, self::test(5)); | |
| self::expect(1.{core::int::unary-}(){() → core::int}, self::test(<dynamic>[])); | |
| } | |
| static method expect(dynamic expected, dynamic actual) → dynamic { | |
| if(!(expected =={core::Object::==}{(core::Object) → core::bool} actual)) { | |
| throw "Expected ${expected}, actual ${actual}"; | |
| } | |
| } | |
| constants { | |
| #C1 = 1 | |
| #C2 = 0 | |
| #C3 = 2 | |
| #C4 = 3 | |
| #C5 = 4 | |
| } |