| library /*isNonNullableByDefault*/; |
| import self as self; |
| import "dart:core" as core; |
| |
| static method test1(dynamic x) → dynamic { |
| #L1: |
| { |
| final synthesized dynamic #0#0 = x; |
| { |
| core::int x; |
| if(#0#0 is{ForNonNullableByDefault} core::int && (let final core::int #t1 = x = #0#0{core::int} in true)) { |
| { |
| { |
| core::String x = "foo"; |
| return x; |
| } |
| } |
| } |
| } |
| { |
| { |
| { |
| return "bar"; |
| } |
| } |
| } |
| } |
| } |
| static method test2(dynamic x) → dynamic { |
| #L2: |
| { |
| final synthesized dynamic #0#0 = x; |
| function ##0#4#initializer() → core::bool |
| return #0#0{core::List<dynamic>}.{core::List::length}{core::int} =={core::num::==}{(core::Object) → core::bool} #C1; |
| late final synthesized core::bool #0#4 = ##0#4#initializer(){() → core::bool}; |
| function ##0#6#initializer() → dynamic |
| return #0#0{core::List<dynamic>}.{core::List::[]}(0){(core::int) → dynamic}; |
| late final synthesized dynamic #0#6 = ##0#6#initializer(){() → dynamic}; |
| function ##0#7#initializer() → dynamic |
| return #0#0{core::List<dynamic>}.{core::List::[]}(1){(core::int) → dynamic}; |
| late final synthesized dynamic #0#7 = ##0#7#initializer(){() → dynamic}; |
| { |
| lowered core::int x#case#0; |
| lowered core::int x#case#1; |
| if(#0#0 is{ForNonNullableByDefault} core::List<dynamic> && #0#4 && (#0#6 is{ForNonNullableByDefault} core::int && (let final core::int #t2 = x#case#0 = #0#6{core::int} in true)) || #0#0 is{ForNonNullableByDefault} core::List<dynamic> && #0#4 && (#0#7 is{ForNonNullableByDefault} core::int && (let final core::int #t3 = x#case#1 = #0#7{core::int} in true))) { |
| { |
| core::String x = "foo"; |
| return x; |
| } |
| } |
| } |
| { |
| { |
| { |
| return "bar"; |
| } |
| } |
| } |
| } |
| } |
| static method test3(dynamic x) → dynamic { |
| { |
| core::int x; |
| final synthesized dynamic #0#0 = x; |
| if(#0#0 is{ForNonNullableByDefault} core::int && (let final core::int #t4 = x = #0#0{core::int} in true)) { |
| core::String x = "foo"; |
| return x; |
| } |
| else { |
| return "bar"; |
| } |
| } |
| } |
| static method test4(dynamic x) → dynamic { |
| core::Function f = () → core::int => 0; |
| { |
| core::int x; |
| final synthesized dynamic #0#0 = x; |
| if(#0#0 is{ForNonNullableByDefault} core::int && (let final core::int #t5 = x = #0#0{core::int} in true)) { |
| core::String x = (() → core::String { |
| f = () → core::int => 1; |
| return "foo"; |
| })(){() → core::String}; |
| } |
| } |
| return f(); |
| } |
| static method main() → dynamic { |
| self::expectEquals(self::test1(0), "foo"); |
| self::expectEquals(self::test1("foo"), "bar"); |
| self::expectEquals(self::test2(core::_GrowableList::_literal2<core::Object>(0, false)), "foo"); |
| self::expectEquals(self::test2(core::_GrowableList::_literal2<core::Object>(false, 0)), "foo"); |
| self::expectEquals(self::test2("foo"), "bar"); |
| self::expectEquals(self::test3(0), "foo"); |
| self::expectEquals(self::test3("foo"), "bar"); |
| self::expectEquals(self::test4(0), 1); |
| self::expectEquals(self::test4("foo"), 0); |
| } |
| static method expectEquals(dynamic x, dynamic y) → dynamic { |
| if(!(x =={core::Object::==}{(core::Object) → core::bool} y)) { |
| throw "Expected '${x}' to be equal to '${y}'."; |
| } |
| } |
| |
| constants { |
| #C1 = 2 |
| } |