Files
sdk/pkg/front_end/testcases/patterns/const_patterns_binary.dart.strong.modular.expect
Jens Johansen 3175e427d8 [CFE] Keep const locals by default; expression evaluation can evaluate const locals
Note: Const locals are still off for VM aot and dart2js for the entry
points I've found in an attempt to retain the old behaviour there.
It might be better if those targets could remove such locals in a
whole-world analysis instead.

 * Keep const locals by default (except as noted above). Update the
   verifier to accept that. For the platforms this has increased the
   size by at most 6584 bytes. With this the VM will pass in any const
   locals as it does normal locals, but as the variable is never
   captured it will never pass a const local defined in a method when
   inside a local function in that method.
 * Change the dart scope calculation(s) to return the found variables
   instead of just the types of the found variables.
 * When the incremental compilers expression compilation - via the dart
   scope calculation - finds a const local that it wasn't told about, it
   will pass it on as an extra variable that it knows about, allowing
   for evaluating const locals in the case not covered by the first
   bullet.

With luck this can in future CLs be extended to know about other
variables that we're not told about, allowing to give a message saying
something like
"yes, we know what 'foo' is, but you can't currently use it" as wanted
in for instance https://github.com/dart-lang/sdk/issues/60316 and
https://github.com/dart-lang/sdk/issues/53996.

Tested: Existing tests for existing functionality; new tests for the new
Change-Id: I1ec24350273e6f81574bb2888f6bf46e3b8b1b47
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/445461
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
2025-08-19 04:30:41 -07:00

352 lines
26 KiB
Plaintext

library;
//
// Problems in library:
//
// pkg/front_end/testcases/patterns/const_patterns_binary.dart:19:12: Error: The binary operator + is not supported as a constant pattern.
// Try wrapping the expression in 'const ( ... )'.
// case 1 + 2: // Error
// ^
//
// pkg/front_end/testcases/patterns/const_patterns_binary.dart:20:12: Error: The binary operator - is not supported as a constant pattern.
// Try wrapping the expression in 'const ( ... )'.
// case 1 - 2: // Error
// ^
//
// pkg/front_end/testcases/patterns/const_patterns_binary.dart:21:12: Error: The binary operator * is not supported as a constant pattern.
// Try wrapping the expression in 'const ( ... )'.
// case 1 * 2: // Error
// ^
//
// pkg/front_end/testcases/patterns/const_patterns_binary.dart:22:12: Error: The binary operator / is not supported as a constant pattern.
// Try wrapping the expression in 'const ( ... )'.
// case 1 / 2: // Error
// ^
//
// pkg/front_end/testcases/patterns/const_patterns_binary.dart:23:12: Error: The binary operator ~/ is not supported as a constant pattern.
// Try wrapping the expression in 'const ( ... )'.
// case 1 ~/ 2: // Error
// ^^
//
// pkg/front_end/testcases/patterns/const_patterns_binary.dart:24:12: Error: The binary operator % is not supported as a constant pattern.
// Try wrapping the expression in 'const ( ... )'.
// case 1 % 2: // Error
// ^
//
// pkg/front_end/testcases/patterns/const_patterns_binary.dart:25:12: Error: The binary operator == is not supported as a constant pattern.
// Try wrapping the expression in 'const ( ... )'.
// case 1 == 2: // Error
// ^^
//
// pkg/front_end/testcases/patterns/const_patterns_binary.dart:26:12: Error: The binary operator != is not supported as a constant pattern.
// Try wrapping the expression in 'const ( ... )'.
// case 1 != 2: // Error
// ^^
//
// pkg/front_end/testcases/patterns/const_patterns_binary.dart:27:12: Error: The binary operator ^ is not supported as a constant pattern.
// Try wrapping the expression in 'const ( ... )'.
// case 1 ^ 2: // Error
// ^
//
// pkg/front_end/testcases/patterns/const_patterns_binary.dart:28:12: Error: The binary operator & is not supported as a constant pattern.
// Try wrapping the expression in 'const ( ... )'.
// case 1 & 2: // Error
// ^
//
// pkg/front_end/testcases/patterns/const_patterns_binary.dart:29:12: Error: The binary operator | is not supported as a constant pattern.
// Try wrapping the expression in 'const ( ... )'.
// case 1 | 2: // Error
// ^
//
// pkg/front_end/testcases/patterns/const_patterns_binary.dart:30:12: Error: The binary operator < is not supported as a constant pattern.
// Try wrapping the expression in 'const ( ... )'.
// case 1 < 2: // Error
// ^
//
// pkg/front_end/testcases/patterns/const_patterns_binary.dart:31:12: Error: The binary operator <= is not supported as a constant pattern.
// Try wrapping the expression in 'const ( ... )'.
// case 1 <= 2: // Error
// ^^
//
// pkg/front_end/testcases/patterns/const_patterns_binary.dart:32:12: Error: The binary operator > is not supported as a constant pattern.
// Try wrapping the expression in 'const ( ... )'.
// case 1 > 2: // Error
// ^
//
// pkg/front_end/testcases/patterns/const_patterns_binary.dart:33:12: Error: The binary operator >= is not supported as a constant pattern.
// Try wrapping the expression in 'const ( ... )'.
// case 1 >= 2: // Error
// ^^
//
// pkg/front_end/testcases/patterns/const_patterns_binary.dart:34:12: Error: The binary operator << is not supported as a constant pattern.
// Try wrapping the expression in 'const ( ... )'.
// case 1 << 2: // Error
// ^^
//
// pkg/front_end/testcases/patterns/const_patterns_binary.dart:35:12: Error: The binary operator >> is not supported as a constant pattern.
// Try wrapping the expression in 'const ( ... )'.
// case 1 >> 2: // Error
// ^^
//
// pkg/front_end/testcases/patterns/const_patterns_binary.dart:36:12: Error: The binary operator >>> is not supported as a constant pattern.
// Try wrapping the expression in 'const ( ... )'.
// case 1 >>> 2: // Error
// ^^^
//
// pkg/front_end/testcases/patterns/const_patterns_binary.dart:37:12: Error: The binary operator + is not supported as a constant pattern.
// Try wrapping the expression in 'const ( ... )'.
// case 1 + 2 + 3: // Error
// ^
//
// pkg/front_end/testcases/patterns/const_patterns_binary.dart:40:16: Error: The expression can't be prefixed by 'const' to form a constant pattern.
// Try wrapping the expression in 'const ( ... )' instead.
// case const 1 as int: // Error
// ^
//
// pkg/front_end/testcases/patterns/const_patterns_binary.dart:41:16: Error: The expression can't be prefixed by 'const' to form a constant pattern.
// Try wrapping the expression in 'const ( ... )' instead.
// case const 1 + 2: // Error
// ^
//
// pkg/front_end/testcases/patterns/const_patterns_binary.dart:42:16: Error: The expression can't be prefixed by 'const' to form a constant pattern.
// Try wrapping the expression in 'const ( ... )' instead.
// case const 1 - 2: // Error
// ^
//
// pkg/front_end/testcases/patterns/const_patterns_binary.dart:43:16: Error: The expression can't be prefixed by 'const' to form a constant pattern.
// Try wrapping the expression in 'const ( ... )' instead.
// case const 1 * 2: // Error
// ^
//
// pkg/front_end/testcases/patterns/const_patterns_binary.dart:44:16: Error: The expression can't be prefixed by 'const' to form a constant pattern.
// Try wrapping the expression in 'const ( ... )' instead.
// case const 1 / 2: // Error
// ^
//
// pkg/front_end/testcases/patterns/const_patterns_binary.dart:45:16: Error: The expression can't be prefixed by 'const' to form a constant pattern.
// Try wrapping the expression in 'const ( ... )' instead.
// case const 1 ~/ 2: // Error
// ^
//
// pkg/front_end/testcases/patterns/const_patterns_binary.dart:46:16: Error: The expression can't be prefixed by 'const' to form a constant pattern.
// Try wrapping the expression in 'const ( ... )' instead.
// case const 1 % 2: // Error
// ^
//
// pkg/front_end/testcases/patterns/const_patterns_binary.dart:47:16: Error: The expression can't be prefixed by 'const' to form a constant pattern.
// Try wrapping the expression in 'const ( ... )' instead.
// case const 1 == 2: // Error
// ^
//
// pkg/front_end/testcases/patterns/const_patterns_binary.dart:48:16: Error: The expression can't be prefixed by 'const' to form a constant pattern.
// Try wrapping the expression in 'const ( ... )' instead.
// case const 1 != 2: // Error
// ^
//
// pkg/front_end/testcases/patterns/const_patterns_binary.dart:49:16: Error: The expression can't be prefixed by 'const' to form a constant pattern.
// Try wrapping the expression in 'const ( ... )' instead.
// case const 1 ^ 2: // Error
// ^
//
// pkg/front_end/testcases/patterns/const_patterns_binary.dart:50:16: Error: The expression can't be prefixed by 'const' to form a constant pattern.
// Try wrapping the expression in 'const ( ... )' instead.
// case const 1 & 2: // Error
// ^
//
// pkg/front_end/testcases/patterns/const_patterns_binary.dart:51:16: Error: The expression can't be prefixed by 'const' to form a constant pattern.
// Try wrapping the expression in 'const ( ... )' instead.
// case const 1 | 2: // Error
// ^
//
// pkg/front_end/testcases/patterns/const_patterns_binary.dart:52:16: Error: The expression can't be prefixed by 'const' to form a constant pattern.
// Try wrapping the expression in 'const ( ... )' instead.
// case const 1 < 2: // Error
// ^
//
// pkg/front_end/testcases/patterns/const_patterns_binary.dart:53:16: Error: The expression can't be prefixed by 'const' to form a constant pattern.
// Try wrapping the expression in 'const ( ... )' instead.
// case const 1 <= 2: // Error
// ^
//
// pkg/front_end/testcases/patterns/const_patterns_binary.dart:54:16: Error: The expression can't be prefixed by 'const' to form a constant pattern.
// Try wrapping the expression in 'const ( ... )' instead.
// case const 1 > 2: // Error
// ^
//
// pkg/front_end/testcases/patterns/const_patterns_binary.dart:55:16: Error: The expression can't be prefixed by 'const' to form a constant pattern.
// Try wrapping the expression in 'const ( ... )' instead.
// case const 1 >= 2: // Error
// ^
//
// pkg/front_end/testcases/patterns/const_patterns_binary.dart:56:16: Error: The expression can't be prefixed by 'const' to form a constant pattern.
// Try wrapping the expression in 'const ( ... )' instead.
// case const 1 << 2: // Error
// ^
//
// pkg/front_end/testcases/patterns/const_patterns_binary.dart:57:16: Error: The expression can't be prefixed by 'const' to form a constant pattern.
// Try wrapping the expression in 'const ( ... )' instead.
// case const 1 >> 2: // Error
// ^
//
// pkg/front_end/testcases/patterns/const_patterns_binary.dart:58:16: Error: The expression can't be prefixed by 'const' to form a constant pattern.
// Try wrapping the expression in 'const ( ... )' instead.
// case const 1 >>> 2: // Error
// ^
//
// pkg/front_end/testcases/patterns/const_patterns_binary.dart:59:16: Error: The expression can't be prefixed by 'const' to form a constant pattern.
// Try wrapping the expression in 'const ( ... )' instead.
// case const 1 + 2 + 3: // Error
// ^
//
// pkg/front_end/testcases/patterns/const_patterns_binary.dart:60:23: Error: The expression can't be prefixed by 'const' to form a constant pattern.
// Try wrapping the expression in 'const ( ... )' instead.
// case const Object() == 2: // Error
// ^
//
// pkg/front_end/testcases/patterns/const_patterns_binary.dart:81:12: Error: Expected ':' before this.
// case 1 ?? 2: // Error
// ^^
//
// pkg/front_end/testcases/patterns/const_patterns_binary.dart:81:12: Error: Expected an identifier, but got '??'.
// Try inserting an identifier before '??'.
// case 1 ?? 2: // Error
// ^^
//
// pkg/front_end/testcases/patterns/const_patterns_binary.dart:81:15: Error: Expected ';' after this.
// case 1 ?? 2: // Error
// ^
//
// pkg/front_end/testcases/patterns/const_patterns_binary.dart:81:16: Error: Expected an identifier, but got ':'.
// Try inserting an identifier before ':'.
// case 1 ?? 2: // Error
// ^
//
// pkg/front_end/testcases/patterns/const_patterns_binary.dart:81:16: Error: Unexpected token ':'.
// case 1 ?? 2: // Error
// ^
//
// pkg/front_end/testcases/patterns/const_patterns_binary.dart:82:10: Error: Not a constant expression.
// case o++: // Error
// ^
//
// pkg/front_end/testcases/patterns/const_patterns_binary.dart:83:10: Error: Not a constant expression.
// case o--: // Error
// ^
//
// pkg/front_end/testcases/patterns/const_patterns_binary.dart:84:12: Error: Not a constant expression.
// case ++o: // Error
// ^
//
// pkg/front_end/testcases/patterns/const_patterns_binary.dart:85:12: Error: Not a constant expression.
// case --o: // Error
// ^
//
import self as self;
import "dart:core" as core;
import "org-dartlang-testcase:///const_patterns_binary.dart" as prefix;
class Class extends core::Object {
static const field core::int value = #C1;
synthetic constructor •() → self::Class
: super core::Object::•()
;
}
static const field core::int value = #C2;
static method method<T extends core::Object? = dynamic>(dynamic o) → dynamic {
#L1:
{
final synthesized dynamic #0#0 = o;
synthesized core::bool #0#2;
synthesized core::bool #0#2#isSet = false;
final const synthesized core::int #0#1 = #C2;
synthesized core::bool #0#4;
synthesized core::bool #0#4#isSet = false;
final const synthesized core::int #0#3 = #C1;
synthesized core::bool #0#6;
synthesized core::bool #0#6#isSet = false;
final const synthesized core::Object #0#7 = #C3;
synthesized core::bool #0#10;
synthesized core::bool #0#10#isSet = false;
final const synthesized core::int #0#9 = #C4;
synthesized core::bool #0#12;
synthesized core::bool #0#12#isSet = false;
final const synthesized core::int #0#11 = #C5;
synthesized core::bool #0#14;
synthesized core::bool #0#14#isSet = false;
final const synthesized core::double #0#13 = #C6;
synthesized core::bool #0#16;
synthesized core::bool #0#16#isSet = false;
final const synthesized core::int #0#15 = #C7;
synthesized core::bool #0#18;
synthesized core::bool #0#18#isSet = false;
final const synthesized core::bool #0#17 = #C8;
synthesized core::bool #0#20;
synthesized core::bool #0#20#isSet = false;
final const synthesized core::bool #0#19 = #C9;
synthesized core::bool #0#22;
synthesized core::bool #0#22#isSet = false;
final const synthesized core::int #0#21 = #C10;
synthesized core::bool #0#24;
synthesized core::bool #0#24#isSet = false;
final const synthesized core::int #0#23 = #C11;
final const synthesized core::List<core::int> #0#29 = #C12;
final const synthesized invalid-type #0#31 = invalid-expression "pkg/front_end/testcases/patterns/const_patterns_binary.dart:82:10: Error: Not a constant expression.
case o++: // Error
^";
final const synthesized invalid-type #0#33 = invalid-expression "pkg/front_end/testcases/patterns/const_patterns_binary.dart:83:10: Error: Not a constant expression.
case o--: // Error
^";
final const synthesized invalid-type #0#35 = invalid-expression "pkg/front_end/testcases/patterns/const_patterns_binary.dart:84:12: Error: Not a constant expression.
case ++o: // Error
^";
final const synthesized invalid-type #0#37 = invalid-expression "pkg/front_end/testcases/patterns/const_patterns_binary.dart:85:12: Error: Not a constant expression.
case --o: // Error
^";
{
if((#0#2#isSet ?{core::bool} #0#2 : let final dynamic #t1 = #0#2#isSet = true in #0#2 = #C2 =={core::num::==}{(core::Object) → core::bool} #0#0) || (#0#4#isSet ?{core::bool} #0#4 : let final dynamic #t2 = #0#4#isSet = true in #0#4 = #C1 =={core::num::==}{(core::Object) → core::bool} #0#0) || (#0#2#isSet ?{core::bool} #0#2 : let final dynamic #t3 = #0#2#isSet = true in #0#2 = #C2 =={core::num::==}{(core::Object) → core::bool} #0#0) && (#0#4#isSet ?{core::bool} #0#4 : let final dynamic #t4 = #0#4#isSet = true in #0#4 = #C1 =={core::num::==}{(core::Object) → core::bool} #0#0) || (let final dynamic #t5 = #0#0 as self::method::T% in #0#6#isSet ?{core::bool} #0#6 : let final dynamic #t6 = #0#6#isSet = true in #0#6 = #C2 =={core::num::==}{(core::Object) → core::bool} #0#0 as self::method::T%) || #C3 =={core::Object::==}{(core::Object) → core::bool} #0#0 || (#0#10#isSet ?{core::bool} #0#10 : let final dynamic #t7 = #0#10#isSet = true in #0#10 = #C4 =={core::num::==}{(core::Object) → core::bool} #0#0) || (#0#12#isSet ?{core::bool} #0#12 : let final dynamic #t8 = #0#12#isSet = true in #0#12 = #C5 =={core::num::==}{(core::Object) → core::bool} #0#0) || (#0#4#isSet ?{core::bool} #0#4 : let final dynamic #t9 = #0#4#isSet = true in #0#4 = #C1 =={core::num::==}{(core::Object) → core::bool} #0#0) || (#0#14#isSet ?{core::bool} #0#14 : let final dynamic #t10 = #0#14#isSet = true in #0#14 = #C6 =={core::num::==}{(core::Object) → core::bool} #0#0) || (#0#16#isSet ?{core::bool} #0#16 : let final dynamic #t11 = #0#16#isSet = true in #0#16 = #C7 =={core::num::==}{(core::Object) → core::bool} #0#0) || (#0#2#isSet ?{core::bool} #0#2 : let final dynamic #t12 = #0#2#isSet = true in #0#2 = #C2 =={core::num::==}{(core::Object) → core::bool} #0#0) || (#0#18#isSet ?{core::bool} #0#18 : let final dynamic #t13 = #0#18#isSet = true in #0#18 = #C8 =={core::Object::==}{(core::Object) → core::bool} #0#0) || (#0#20#isSet ?{core::bool} #0#20 : let final dynamic #t14 = #0#20#isSet = true in #0#20 = #C9 =={core::Object::==}{(core::Object) → core::bool} #0#0) || (#0#10#isSet ?{core::bool} #0#10 : let final dynamic #t15 = #0#10#isSet = true in #0#10 = #C4 =={core::num::==}{(core::Object) → core::bool} #0#0) || (#0#16#isSet ?{core::bool} #0#16 : let final dynamic #t16 = #0#16#isSet = true in #0#16 = #C7 =={core::num::==}{(core::Object) → core::bool} #0#0) || (#0#10#isSet ?{core::bool} #0#10 : let final dynamic #t17 = #0#10#isSet = true in #0#10 = #C4 =={core::num::==}{(core::Object) → core::bool} #0#0) || (#0#20#isSet ?{core::bool} #0#20 : let final dynamic #t18 = #0#20#isSet = true in #0#20 = #C9 =={core::Object::==}{(core::Object) → core::bool} #0#0) || (#0#20#isSet ?{core::bool} #0#20 : let final dynamic #t19 = #0#20#isSet = true in #0#20 = #C9 =={core::Object::==}{(core::Object) → core::bool} #0#0) || (#0#18#isSet ?{core::bool} #0#18 : let final dynamic #t20 = #0#18#isSet = true in #0#18 = #C8 =={core::Object::==}{(core::Object) → core::bool} #0#0) || (#0#18#isSet ?{core::bool} #0#18 : let final dynamic #t21 = #0#18#isSet = true in #0#18 = #C8 =={core::Object::==}{(core::Object) → core::bool} #0#0) || (#0#22#isSet ?{core::bool} #0#22 : let final dynamic #t22 = #0#22#isSet = true in #0#22 = #C10 =={core::num::==}{(core::Object) → core::bool} #0#0) || (#0#16#isSet ?{core::bool} #0#16 : let final dynamic #t23 = #0#16#isSet = true in #0#16 = #C7 =={core::num::==}{(core::Object) → core::bool} #0#0) || (#0#16#isSet ?{core::bool} #0#16 : let final dynamic #t24 = #0#16#isSet = true in #0#16 = #C7 =={core::num::==}{(core::Object) → core::bool} #0#0) || (#0#24#isSet ?{core::bool} #0#24 : let final dynamic #t25 = #0#24#isSet = true in #0#24 = #C11 =={core::num::==}{(core::Object) → core::bool} #0#0) || (let final dynamic #t26 = #0#0 as self::method::T% in #0#6#isSet ?{core::bool} #0#6 : let final dynamic #t27 = #0#6#isSet = true in #0#6 = #C2 =={core::num::==}{(core::Object) → core::bool} #0#0 as self::method::T%) || (let final dynamic #t28 = #0#0 as self::method::T% in #C1 =={core::num::==}{(core::Object) → core::bool} #0#0 as self::method::T%) || (let final dynamic #t29 = #0#0 as core::int in #C2 =={core::num::==}{(core::Object) → core::bool} #0#0 as core::int) || (#0#10#isSet ?{core::bool} #0#10 : let final dynamic #t30 = #0#10#isSet = true in #0#10 = #C4 =={core::num::==}{(core::Object) → core::bool} #0#0) || (#0#12#isSet ?{core::bool} #0#12 : let final dynamic #t31 = #0#12#isSet = true in #0#12 = #C5 =={core::num::==}{(core::Object) → core::bool} #0#0) || (#0#4#isSet ?{core::bool} #0#4 : let final dynamic #t32 = #0#4#isSet = true in #0#4 = #C1 =={core::num::==}{(core::Object) → core::bool} #0#0) || (#0#14#isSet ?{core::bool} #0#14 : let final dynamic #t33 = #0#14#isSet = true in #0#14 = #C6 =={core::num::==}{(core::Object) → core::bool} #0#0) || (#0#16#isSet ?{core::bool} #0#16 : let final dynamic #t34 = #0#16#isSet = true in #0#16 = #C7 =={core::num::==}{(core::Object) → core::bool} #0#0) || (#0#2#isSet ?{core::bool} #0#2 : let final dynamic #t35 = #0#2#isSet = true in #0#2 = #C2 =={core::num::==}{(core::Object) → core::bool} #0#0) || (#0#18#isSet ?{core::bool} #0#18 : let final dynamic #t36 = #0#18#isSet = true in #0#18 = #C8 =={core::Object::==}{(core::Object) → core::bool} #0#0) || (#0#20#isSet ?{core::bool} #0#20 : let final dynamic #t37 = #0#20#isSet = true in #0#20 = #C9 =={core::Object::==}{(core::Object) → core::bool} #0#0) || (#0#10#isSet ?{core::bool} #0#10 : let final dynamic #t38 = #0#10#isSet = true in #0#10 = #C4 =={core::num::==}{(core::Object) → core::bool} #0#0) || (#0#16#isSet ?{core::bool} #0#16 : let final dynamic #t39 = #0#16#isSet = true in #0#16 = #C7 =={core::num::==}{(core::Object) → core::bool} #0#0) || (#0#10#isSet ?{core::bool} #0#10 : let final dynamic #t40 = #0#10#isSet = true in #0#10 = #C4 =={core::num::==}{(core::Object) → core::bool} #0#0) || (#0#20#isSet ?{core::bool} #0#20 : let final dynamic #t41 = #0#20#isSet = true in #0#20 = #C9 =={core::Object::==}{(core::Object) → core::bool} #0#0) || (#0#20#isSet ?{core::bool} #0#20 : let final dynamic #t42 = #0#20#isSet = true in #0#20 = #C9 =={core::Object::==}{(core::Object) → core::bool} #0#0) || (#0#18#isSet ?{core::bool} #0#18 : let final dynamic #t43 = #0#18#isSet = true in #0#18 = #C8 =={core::Object::==}{(core::Object) → core::bool} #0#0) || (#0#18#isSet ?{core::bool} #0#18 : let final dynamic #t44 = #0#18#isSet = true in #0#18 = #C8 =={core::Object::==}{(core::Object) → core::bool} #0#0) || (#0#22#isSet ?{core::bool} #0#22 : let final dynamic #t45 = #0#22#isSet = true in #0#22 = #C10 =={core::num::==}{(core::Object) → core::bool} #0#0) || (#0#16#isSet ?{core::bool} #0#16 : let final dynamic #t46 = #0#16#isSet = true in #0#16 = #C7 =={core::num::==}{(core::Object) → core::bool} #0#0) || (#0#16#isSet ?{core::bool} #0#16 : let final dynamic #t47 = #0#16#isSet = true in #0#16 = #C7 =={core::num::==}{(core::Object) → core::bool} #0#0) || (#0#24#isSet ?{core::bool} #0#24 : let final dynamic #t48 = #0#24#isSet = true in #0#24 = #C11 =={core::num::==}{(core::Object) → core::bool} #0#0) || (#0#18#isSet ?{core::bool} #0#18 : let final dynamic #t49 = #0#18#isSet = true in #0#18 = #C8 =={core::Object::==}{(core::Object) → core::bool} #0#0) || (let final dynamic #t50 = #0#0 as core::List<self::method::T%> in #C12 =={core::List::==}{(core::Object) → core::bool} #0#0 as core::List<self::method::T%>) || (#0#10#isSet ?{core::bool} #0#10 : let final dynamic #t51 = #0#10#isSet = true in #0#10 = #C4 =={core::num::==}{(core::Object) → core::bool} #0#0) || (#0#12#isSet ?{core::bool} #0#12 : let final dynamic #t52 = #0#12#isSet = true in #0#12 = #C5 =={core::num::==}{(core::Object) → core::bool} #0#0) || (#0#4#isSet ?{core::bool} #0#4 : let final dynamic #t53 = #0#4#isSet = true in #0#4 = #C1 =={core::num::==}{(core::Object) → core::bool} #0#0) || (#0#14#isSet ?{core::bool} #0#14 : let final dynamic #t54 = #0#14#isSet = true in #0#14 = #C6 =={core::num::==}{(core::Object) → core::bool} #0#0) || (#0#16#isSet ?{core::bool} #0#16 : let final dynamic #t55 = #0#16#isSet = true in #0#16 = #C7 =={core::num::==}{(core::Object) → core::bool} #0#0) || (#0#2#isSet ?{core::bool} #0#2 : let final dynamic #t56 = #0#2#isSet = true in #0#2 = #C2 =={core::num::==}{(core::Object) → core::bool} #0#0) || (#0#18#isSet ?{core::bool} #0#18 : let final dynamic #t57 = #0#18#isSet = true in #0#18 = #C8 =={core::Object::==}{(core::Object) → core::bool} #0#0) || (#0#20#isSet ?{core::bool} #0#20 : let final dynamic #t58 = #0#20#isSet = true in #0#20 = #C9 =={core::Object::==}{(core::Object) → core::bool} #0#0) || (#0#10#isSet ?{core::bool} #0#10 : let final dynamic #t59 = #0#10#isSet = true in #0#10 = #C4 =={core::num::==}{(core::Object) → core::bool} #0#0) || (#0#16#isSet ?{core::bool} #0#16 : let final dynamic #t60 = #0#16#isSet = true in #0#16 = #C7 =={core::num::==}{(core::Object) → core::bool} #0#0) || (#0#10#isSet ?{core::bool} #0#10 : let final dynamic #t61 = #0#10#isSet = true in #0#10 = #C4 =={core::num::==}{(core::Object) → core::bool} #0#0) || (#0#20#isSet ?{core::bool} #0#20 : let final dynamic #t62 = #0#20#isSet = true in #0#20 = #C9 =={core::Object::==}{(core::Object) → core::bool} #0#0) || (#0#20#isSet ?{core::bool} #0#20 : let final dynamic #t63 = #0#20#isSet = true in #0#20 = #C9 =={core::Object::==}{(core::Object) → core::bool} #0#0) || (#0#18#isSet ?{core::bool} #0#18 : let final dynamic #t64 = #0#18#isSet = true in #0#18 = #C8 =={core::Object::==}{(core::Object) → core::bool} #0#0) || (#0#18#isSet ?{core::bool} #0#18 : let final dynamic #t65 = #0#18#isSet = true in #0#18 = #C8 =={core::Object::==}{(core::Object) → core::bool} #0#0) || (#0#22#isSet ?{core::bool} #0#22 : let final dynamic #t66 = #0#22#isSet = true in #0#22 = #C10 =={core::num::==}{(core::Object) → core::bool} #0#0) || (#0#16#isSet ?{core::bool} #0#16 : let final dynamic #t67 = #0#16#isSet = true in #0#16 = #C7 =={core::num::==}{(core::Object) → core::bool} #0#0) || (#0#16#isSet ?{core::bool} #0#16 : let final dynamic #t68 = #0#16#isSet = true in #0#16 = #C7 =={core::num::==}{(core::Object) → core::bool} #0#0) || (#0#24#isSet ?{core::bool} #0#24 : let final dynamic #t69 = #0#24#isSet = true in #0#24 = #C11 =={core::num::==}{(core::Object) → core::bool} #0#0) || (#0#2#isSet ?{core::bool} #0#2 : let final dynamic #t70 = #0#2#isSet = true in #0#2 = #C2 =={core::num::==}{(core::Object) → core::bool} #0#0)) {
{
let final invalid-type #t71 = invalid-expression "pkg/front_end/testcases/patterns/const_patterns_binary.dart:81:12: Error: This couldn't be parsed.
case 1 ?? 2: // Error
^" in #t71 == null ?{invalid-type} 2 : #t71;
invalid-expression "pkg/front_end/testcases/patterns/const_patterns_binary.dart:81:16: Error: This couldn't be parsed.
case 1 ?? 2: // Error
^";
break #L1;
}
}
}
{
if(invalid-expression "pkg/front_end/testcases/patterns/const_patterns_binary.dart:82:10: Error: Not a constant expression.
case o++: // Error
^" =={core::Object::==}{(core::Object) → core::bool} #0#0 || invalid-expression "pkg/front_end/testcases/patterns/const_patterns_binary.dart:83:10: Error: Not a constant expression.
case o--: // Error
^" =={core::Object::==}{(core::Object) → core::bool} #0#0 || invalid-expression "pkg/front_end/testcases/patterns/const_patterns_binary.dart:84:12: Error: Not a constant expression.
case ++o: // Error
^" =={core::Object::==}{(core::Object) → core::bool} #0#0 || invalid-expression "pkg/front_end/testcases/patterns/const_patterns_binary.dart:85:12: Error: Not a constant expression.
case --o: // Error
^" =={core::Object::==}{(core::Object) → core::bool} #0#0) {
}
}
}
}
constants {
#C1 = 2
#C2 = 1
#C3 = core::Object {}
#C4 = 3
#C5 = -1
#C6 = 0.5
#C7 = 0
#C8 = false
#C9 = true
#C10 = 4
#C11 = 6
#C12 = <core::int>[]
}
Constructor coverage from constants:
org-dartlang-testcase:///const_patterns_binary.dart:
- Object. (from org-dartlang-sdk:///sdk/lib/core/object.dart)