| library; |
| // |
| // Problems in library: |
| // |
| // pkg/front_end/testcases/patterns/logical_or_inside_if_case.dart:10:19: Error: Variable pattern 'y' doesn't have the same type or finality in all cases. |
| // if (x case [int y, var _] || [var _, String y]) { // Error |
| // ^ |
| // |
| // pkg/front_end/testcases/patterns/logical_or_inside_if_case.dart:26:19: Error: Variable pattern 'y' doesn't have the same type or finality in all cases. |
| // if (x case [int y, var _, _] || [var _, String y, _] || [var _, bool y, _]) { |
| // ^ |
| // |
| import self as self; |
| import "dart:core" as core; |
| |
| static method test1(dynamic x) → dynamic { |
| { |
| final synthesized dynamic #0#0 = x; |
| if(#0#0 is core::int? || #0#0 is core::double?) { |
| } |
| } |
| } |
| static method test2(dynamic x) → dynamic { |
| { |
| final synthesized dynamic #0#0 = x; |
| synthesized core::bool #0#4; |
| synthesized core::bool #0#4#isSet = false; |
| synthesized dynamic #0#6; |
| synthesized core::bool #0#6#isSet = false; |
| synthesized dynamic #0#7; |
| synthesized core::bool #0#7#isSet = false; |
| { |
| hoisted invalid-type y; |
| if(#0#0 is core::List<dynamic> && (#0#4#isSet ?{core::bool} #0#4{core::bool} : let final core::bool #t1 = #0#4#isSet = true in #0#4 = #0#0{core::List<dynamic>}.{core::List::length}{core::int} =={core::num::==}{(core::Object) → core::bool} #C1) && ((#0#6#isSet ?{dynamic} #0#6{dynamic} : let final core::bool #t2 = #0#6#isSet = true in #0#6 = #0#0{core::List<dynamic>}.{core::List::[]}(0){(core::int) → dynamic}) is core::int && (let final invalid-type #t3 = y = (#0#6#isSet ?{dynamic} #0#6{dynamic} : let final core::bool #t4 = #0#6#isSet = true in #0#6 = #0#0{core::List<dynamic>}.{core::List::[]}(0){(core::int) → dynamic}) as{Unchecked} invalid-type in true)) || #0#0 is core::List<dynamic> && (#0#4#isSet ?{core::bool} #0#4{core::bool} : let final core::bool #t5 = #0#4#isSet = true in #0#4 = #0#0{core::List<dynamic>}.{core::List::length}{core::int} =={core::num::==}{(core::Object) → core::bool} #C1) && ((#0#7#isSet ?{dynamic} #0#7{dynamic} : let final core::bool #t6 = #0#7#isSet = true in #0#7 = #0#0{core::List<dynamic>}.{core::List::[]}(1){(core::int) → dynamic}) is core::String && (let final invalid-type #t7 = y = (#0#7#isSet ?{dynamic} #0#7{dynamic} : let final core::bool #t8 = #0#7#isSet = true in #0#7 = #0#0{core::List<dynamic>}.{core::List::[]}(1){(core::int) → dynamic}) as{Unchecked} invalid-type in true))) { |
| return y; |
| } |
| else { |
| return null; |
| } |
| } |
| } |
| } |
| static method test3(dynamic x) → dynamic { |
| { |
| final synthesized dynamic #0#0 = x; |
| if(#0#0 =={core::Object::==}{(core::Object) → core::bool} #C2 || #0#0 =={core::Object::==}{(core::Object) → core::bool} #C1 || #0#0 =={core::Object::==}{(core::Object) → core::bool} #C3) { |
| return 0; |
| } |
| else { |
| return 1; |
| } |
| } |
| } |
| static method test4(dynamic x) → dynamic { |
| { |
| final synthesized dynamic #0#0 = x; |
| synthesized core::bool #0#4; |
| synthesized core::bool #0#4#isSet = false; |
| synthesized dynamic #0#6; |
| synthesized core::bool #0#6#isSet = false; |
| synthesized dynamic #0#7; |
| synthesized core::bool #0#7#isSet = false; |
| { |
| hoisted invalid-type y; |
| if(#0#0 is core::List<dynamic> && (#0#4#isSet ?{core::bool} #0#4{core::bool} : let final core::bool #t9 = #0#4#isSet = true in #0#4 = #0#0{core::List<dynamic>}.{core::List::length}{core::int} =={core::num::==}{(core::Object) → core::bool} #C3) && ((#0#6#isSet ?{dynamic} #0#6{dynamic} : let final core::bool #t10 = #0#6#isSet = true in #0#6 = #0#0{core::List<dynamic>}.{core::List::[]}(0){(core::int) → dynamic}) is core::int && (let final invalid-type #t11 = y = (#0#6#isSet ?{dynamic} #0#6{dynamic} : let final core::bool #t12 = #0#6#isSet = true in #0#6 = #0#0{core::List<dynamic>}.{core::List::[]}(0){(core::int) → dynamic}) as{Unchecked} invalid-type in true)) || #0#0 is core::List<dynamic> && (#0#4#isSet ?{core::bool} #0#4{core::bool} : let final core::bool #t13 = #0#4#isSet = true in #0#4 = #0#0{core::List<dynamic>}.{core::List::length}{core::int} =={core::num::==}{(core::Object) → core::bool} #C3) && ((#0#7#isSet ?{dynamic} #0#7{dynamic} : let final core::bool #t14 = #0#7#isSet = true in #0#7 = #0#0{core::List<dynamic>}.{core::List::[]}(1){(core::int) → dynamic}) is core::String && (let final invalid-type #t15 = y = (#0#7#isSet ?{dynamic} #0#7{dynamic} : let final core::bool #t16 = #0#7#isSet = true in #0#7 = #0#0{core::List<dynamic>}.{core::List::[]}(1){(core::int) → dynamic}) as{Unchecked} invalid-type in true)) || #0#0 is core::List<dynamic> && (#0#4#isSet ?{core::bool} #0#4{core::bool} : let final core::bool #t17 = #0#4#isSet = true in #0#4 = #0#0{core::List<dynamic>}.{core::List::length}{core::int} =={core::num::==}{(core::Object) → core::bool} #C3) && ((#0#7#isSet ?{dynamic} #0#7{dynamic} : let final core::bool #t18 = #0#7#isSet = true in #0#7 = #0#0{core::List<dynamic>}.{core::List::[]}(1){(core::int) → dynamic}) is core::bool && (let final invalid-type #t19 = y = (#0#7#isSet ?{dynamic} #0#7{dynamic} : let final core::bool #t20 = #0#7#isSet = true in #0#7 = #0#0{core::List<dynamic>}.{core::List::[]}(1){(core::int) → dynamic}) as{Unchecked} invalid-type in true))) { |
| return y; |
| } |
| else { |
| return null; |
| } |
| } |
| } |
| } |
| |
| constants { |
| #C1 = 2 |
| #C2 = 1 |
| #C3 = 3 |
| } |