blob: e6d8fc633b76bb99d1205deb2a8fef58eb377a3c [file] [log] [blame]
library;
//
// Problems in library:
//
// pkg/front_end/testcases/patterns/mismatching_joint_pattern_variables.dart:14:14: Error: Variable pattern 'y' doesn't have the same type or finality in all cases.
// return y;
// ^
//
// pkg/front_end/testcases/patterns/mismatching_joint_pattern_variables.dart:15:14: Error: Variable pattern 'y' doesn't have the same type or finality in all cases.
// case int y || [var y] when y == 0: // Error.
// ^
//
// pkg/front_end/testcases/patterns/mismatching_joint_pattern_variables.dart:17:14: Error: Variable pattern 'y' doesn't have the same type or finality in all cases.
// case int y || [final int y] when y == 0: // Error.
// ^
//
// pkg/front_end/testcases/patterns/mismatching_joint_pattern_variables.dart:10:14: Error: Variable pattern 'y' doesn't have the same type or finality in all cases.
// return y;
// ^
//
import self as self;
import "dart:core" as core;
static method test(dynamic x) dynamic {
#L1:
{
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;
dynamic #t1;
dynamic #t2;
{
lowered hoisted core::int y#case#0;
lowered hoisted dynamic y#case#1;
if(#0#0 is core::int && (let final core::int #t3 = y#case#0 = #0#0{core::int} in true) && y#case#0 =={core::num::==}{(core::Object) → core::bool} 0 && (let final core::int #t4 = #t1 = y#case#0 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) && (let final dynamic #t6 = y#case#1 = #0#6#isSet ?{dynamic} #0#6{dynamic} : let final core::bool* #t7 = #0#6#isSet = true in #0#6 = #0#0{core::List<dynamic>}.{core::List::[]}(0){(core::int) → dynamic} in true) && y#case#1 =={core::Object::==}{(core::Object) → core::bool} 0 && (let final dynamic #t8 = #t1 = y#case#1 in true)) {
core::int y = invalid-expression "pkg/front_end/testcases/patterns/mismatching_joint_pattern_variables.dart:10:14: Error: Variable pattern 'y' doesn't have the same type or finality in all cases.
return y;
^";
{
return y;
}
}
}
{
lowered hoisted core::int y#case#0;
lowered final hoisted core::int y#case#1;
if(#0#0 is core::int && (let final core::int #t9 = y#case#0 = #0#0{core::int} in true) && y#case#0 =={core::num::==}{(core::Object) → core::bool} 0 && (let final core::int #t10 = #t2 = y#case#0 in true) || #0#0 is core::List<dynamic> && (#0#4#isSet ?{core::bool} #0#4{core::bool} : let final core::bool* #t11 = #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* #t12 = #0#6#isSet = true in #0#6 = #0#0{core::List<dynamic>}.{core::List::[]}(0){(core::int) → dynamic}) is core::int && (let final core::int #t13 = y#case#1 = (#0#6#isSet ?{dynamic} #0#6{dynamic} : let final core::bool* #t14 = #0#6#isSet = true in #0#6 = #0#0{core::List<dynamic>}.{core::List::[]}(0){(core::int) → dynamic}) as{Unchecked} core::int in true)) && y#case#1 =={core::num::==}{(core::Object) → core::bool} 0 && (let final core::int #t15 = #t2 = y#case#1 in true)) {
core::int y = #t2{core::int};
{
return y;
}
}
}
{
hoisted invalid-type y;
if((#0#0 is core::int && (let final invalid-type #t16 = y = #0#0{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} #C1) && (let final invalid-type #t18 = y = (#0#6#isSet ?{dynamic} #0#6{dynamic} : let final core::bool* #t19 = #0#6#isSet = true in #0#6 = #0#0{core::List<dynamic>}.{core::List::[]}(0){(core::int) → dynamic}) as{Unchecked} invalid-type in true)) && y =={core::Object::==}{(core::Object) → core::bool} 0) {
{
return y;
}
}
}
{
hoisted core::int y;
if((#0#0 is core::int && (let final core::int #t20 = y = #0#0{core::int} in true) || #0#0 is core::List<dynamic> && (#0#4#isSet ?{core::bool} #0#4{core::bool} : let final core::bool* #t21 = #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* #t22 = #0#6#isSet = true in #0#6 = #0#0{core::List<dynamic>}.{core::List::[]}(0){(core::int) → dynamic}) is core::int && (let final core::int #t23 = y = (#0#6#isSet ?{dynamic} #0#6{dynamic} : let final core::bool* #t24 = #0#6#isSet = true in #0#6 = #0#0{core::List<dynamic>}.{core::List::[]}(0){(core::int) → dynamic}) as{Unchecked} core::int in true))) && y =={core::num::==}{(core::Object) → core::bool} 0) {
{
return y;
}
}
}
{
{
{
return null;
}
}
}
}
}
constants {
#C1 = 1
}