blob: 6efe62a1c290ed32ac304d9e0678e1ea927fcd87 [file]
library;
//
// Problems in library:
//
// pkg/front_end/testcases/patterns/pattern_assignment_refutable_subpattern.dart:11:6: Error: Refutable patterns can't be used in an irrefutable context.
// Try using an if-case, a 'switch' statement, or a 'switch' expression instead.
// [x || y] = list;
// ^
//
// pkg/front_end/testcases/patterns/pattern_assignment_refutable_subpattern.dart:17:5: Error: Refutable patterns can't be used in an irrefutable context.
// Try using an if-case, a 'switch' statement, or a 'switch' expression instead.
// [x?] = list;
// ^
//
import self as self;
import "dart:core" as core;
static method orPattern(core::List<core::Object?> list) → dynamic {
core::Object? x;
core::Object? y;
{
final synthesized core::List<core::Object?> #0#0 = list;
final const synthesized core::int #0#2 = #C1;
if(!(#0#0.{core::List::length}{core::int} =={core::num::==}{(core::Object) → core::bool} #C1 && invalid-expression "pkg/front_end/testcases/patterns/pattern_assignment_refutable_subpattern.dart:11:6: Error: Refutable patterns can't be used in an irrefutable context.
Try using an if-case, a 'switch' statement, or a 'switch' expression instead.
[x || y] = list;
^"))
throw{for-error-handling} new core::StateError::•("Pattern matching error");
}
return <core::Object?>[x, y];
}
static method nullCheckPattern(core::List<core::Object?> list) → dynamic {
core::Object? x;
{
final synthesized core::List<core::Object?> #0#0 = list;
final const synthesized core::int #0#2 = #C1;
synthesized core::Object? #0#4;
synthesized core::bool #0#4#isSet = false;
if(!(#0#0.{core::List::length}{core::int} =={core::num::==}{(core::Object) → core::bool} #C1 && (!((#0#4#isSet ?{core::Object?} #0#4 : let final dynamic #t1 = #0#4#isSet = true in #0#4 = #0#0.{core::List::[]}(0){(core::int) → core::Object?}) == null) && (let final dynamic #t2 = x = (#0#4#isSet ?{core::Object?} #0#4 : let final dynamic #t3 = #0#4#isSet = true in #0#4 = #0#0.{core::List::[]}(0){(core::int) → core::Object?}) as{Unchecked} core::Object in true))))
throw{for-error-handling} new core::StateError::•("Pattern matching error");
}
return x{core::Object};
}
constants {
#C1 = 1
}