blob: 3bcbd2100a77152b3fbd0032b39b67c8d9b23a95 [file] [log] [blame]
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;
late final synthesized core::bool #0#2 = #C2 =={core::num::==}{(core::Object) → core::bool} #0#0;
late final synthesized core::bool #0#4 = #C1 =={core::num::==}{(core::Object) → core::bool} #0#0;
late final synthesized core::bool #0#6 = #C2 =={core::num::==}{(core::Object) → core::bool} #0#0 as self::method::T%;
late final synthesized core::bool #0#10 = #C3 =={core::num::==}{(core::Object) → core::bool} #0#0;
late final synthesized core::bool #0#12 = #C4 =={core::num::==}{(core::Object) → core::bool} #0#0;
late final synthesized core::bool #0#14 = #C5 =={core::num::==}{(core::Object) → core::bool} #0#0;
late final synthesized core::bool #0#16 = #C6 =={core::num::==}{(core::Object) → core::bool} #0#0;
late final synthesized core::bool #0#18 = #C7 =={core::Object::==}{(core::Object) → core::bool} #0#0;
late final synthesized core::bool #0#20 = #C8 =={core::Object::==}{(core::Object) → core::bool} #0#0;
late final synthesized core::bool #0#22 = #C9 =={core::num::==}{(core::Object) → core::bool} #0#0;
late final synthesized core::bool #0#24 = #C10 =={core::num::==}{(core::Object) → core::bool} #0#0;
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 || #0#4 || #0#2 && #0#4 || (let final dynamic #t1 = #0#0 as self::method::T% in #0#6) || #C11 =={core::Object::==}{(core::Object) → core::bool} #0#0 || #0#10 || #0#12 || #0#4 || #0#14 || #0#16 || #0#2 || #0#18 || #0#20 || #0#10 || #0#16 || #0#10 || #0#20 || #0#20 || #0#18 || #0#18 || #0#22 || #0#16 || #0#16 || #0#24 || (let final dynamic #t2 = #0#0 as self::method::T% in #0#6) || (let final dynamic #t3 = #0#0 as self::method::T% in #C1 =={core::num::==}{(core::Object) → core::bool} #0#0 as self::method::T%) || (let final dynamic #t4 = #0#0 as core::int in #C2 =={core::num::==}{(core::Object) → core::bool} #0#0 as core::int) || #0#10 || #0#12 || #0#4 || #0#14 || #0#16 || #0#2 || #0#18 || #0#20 || #0#10 || #0#16 || #0#10 || #0#20 || #0#20 || #0#18 || #0#18 || #0#22 || #0#16 || #0#16 || #0#24 || #0#18 || (let final dynamic #t5 = #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 || #0#12 || #0#4 || #0#14 || #0#16 || #0#2 || #0#18 || #0#20 || #0#10 || #0#16 || #0#10 || #0#20 || #0#20 || #0#18 || #0#18 || #0#22 || #0#16 || #0#16 || #0#24 || #0#2) {
{
let final invalid-type #t6 = invalid-expression "pkg/front_end/testcases/patterns/const_patterns_binary.dart:81:12: Error: This couldn't be parsed.
case 1 ?? 2: // Error
^" in #t6 == null ?{invalid-type} 2 : #t6;
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 = 3
#C4 = -1
#C5 = 0.5
#C6 = 0
#C7 = false
#C8 = true
#C9 = 4
#C10 = 6
#C11 = core::Object {}
#C12 = <core::int*>[]
}
Constructor coverage from constants:
org-dartlang-testcase:///const_patterns_binary.dart:
- Object. (from org-dartlang-sdk:///sdk/lib/core/object.dart)