354e8068a4
This makes it easier to navigate around in editors that can go to matching braces/parenthesis (e.g. jump from end of constant section to start). TEST=Fixes kernel text printer & updates tests. Change-Id: I6cbf34f5a62e11454e5de4d5fc9a313e0c6cf36c Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/283641 Reviewed-by: Jens Johansen <jensj@google.com> Commit-Queue: Martin Kustermann <kustermann@google.com>
423 lines
26 KiB
Plaintext
423 lines
26 KiB
Plaintext
library /*isNonNullableByDefault*/;
|
|
//
|
|
// Problems in library:
|
|
//
|
|
// pkg/front_end/testcases/patterns/const_patterns.dart:26:12: Error: Method invocation is not a constant expression.
|
|
// case super(): // Error
|
|
// ^^^^
|
|
//
|
|
// pkg/front_end/testcases/patterns/const_patterns.dart:43:13: Error: Only negation of a numeric literal is supported as a constant pattern.
|
|
// Try wrapping the expression in 'const ( ... )'.
|
|
// case -value: // Error
|
|
// ^^^^^
|
|
//
|
|
// pkg/front_end/testcases/patterns/const_patterns.dart:45:13: Error: Only negation of a numeric literal is supported as a constant pattern.
|
|
// Try wrapping the expression in 'const ( ... )'.
|
|
// case -local: // Error
|
|
// ^^^^^
|
|
//
|
|
// pkg/front_end/testcases/patterns/const_patterns.dart:48:13: Error: Only negation of a numeric literal is supported as a constant pattern.
|
|
// Try wrapping the expression in 'const ( ... )'.
|
|
// case -prefix.value: // Error
|
|
// ^^^^^^
|
|
//
|
|
// pkg/front_end/testcases/patterns/const_patterns.dart:48:20: Error: Only negation of a numeric literal is supported as a constant pattern.
|
|
// Try wrapping the expression in 'const ( ... )'.
|
|
// case -prefix.value: // Error
|
|
// ^^^^^
|
|
//
|
|
// pkg/front_end/testcases/patterns/const_patterns.dart:50:14: 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.dart:51:14: 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.dart:52:20: Error: Expected ':' before this.
|
|
// case void fun() {}: // Error
|
|
// ^
|
|
//
|
|
// pkg/front_end/testcases/patterns/const_patterns.dart:52:24: Error: Expected ';' after this.
|
|
// case void fun() {}: // Error
|
|
// ^
|
|
//
|
|
// pkg/front_end/testcases/patterns/const_patterns.dart:52:25: Error: Expected an identifier, but got ':'.
|
|
// Try inserting an identifier before ':'.
|
|
// case void fun() {}: // Error
|
|
// ^
|
|
//
|
|
// pkg/front_end/testcases/patterns/const_patterns.dart:52:25: Error: Unexpected token ':'.
|
|
// case void fun() {}: // Error
|
|
// ^
|
|
//
|
|
// pkg/front_end/testcases/patterns/const_patterns.dart:53:12: Error: `assert` can't be used as an expression.
|
|
// case assert(false): // Error
|
|
// ^^^^^^
|
|
//
|
|
// pkg/front_end/testcases/patterns/const_patterns.dart:54:20: Error: Not a constant expression.
|
|
// case switch (o) { _ => true }: // Error
|
|
// ^
|
|
//
|
|
// pkg/front_end/testcases/patterns/const_patterns.dart:56:12: Error: The unary operator ! is not supported as a constant pattern.
|
|
// Try wrapping the expression in 'const ( ... )'.
|
|
// case !false: // Error
|
|
// ^
|
|
//
|
|
// pkg/front_end/testcases/patterns/const_patterns.dart:57:12: Error: The unary operator ~ is not supported as a constant pattern.
|
|
// Try wrapping the expression in 'const ( ... )'.
|
|
// case ~0: // Error
|
|
// ^
|
|
//
|
|
// pkg/front_end/testcases/patterns/const_patterns.dart:58:14: Error: Not a constant expression.
|
|
// case ++variable: // Error
|
|
// ^^^^^^^^
|
|
//
|
|
// pkg/front_end/testcases/patterns/const_patterns.dart:59:18: Error: The expression can't be prefixed by 'const' to form a constant pattern.
|
|
// Try wrapping the expression in 'const ( ... )' instead.
|
|
// case const 0: // Error
|
|
// ^
|
|
//
|
|
// pkg/front_end/testcases/patterns/const_patterns.dart:60:18: Error: The expression can't be prefixed by 'const' to form a constant pattern.
|
|
// Try wrapping the expression in 'const ( ... )' instead.
|
|
// case const 0x0: // Error
|
|
// ^^^
|
|
//
|
|
// pkg/front_end/testcases/patterns/const_patterns.dart:61:18: Error: The expression can't be prefixed by 'const' to form a constant pattern.
|
|
// Try wrapping the expression in 'const ( ... )' instead.
|
|
// case const 0.5: // Error
|
|
// ^^^
|
|
//
|
|
// pkg/front_end/testcases/patterns/const_patterns.dart:62:18: Error: The expression can't be prefixed by 'const' to form a constant pattern.
|
|
// Try wrapping the expression in 'const ( ... )' instead.
|
|
// case const true: // Error
|
|
// ^^^^
|
|
//
|
|
// pkg/front_end/testcases/patterns/const_patterns.dart:63:18: Error: The expression can't be prefixed by 'const' to form a constant pattern.
|
|
// Try wrapping the expression in 'const ( ... )' instead.
|
|
// case const null: // Error
|
|
// ^^^^
|
|
//
|
|
// pkg/front_end/testcases/patterns/const_patterns.dart:64:18: Error: The expression can't be prefixed by 'const' to form a constant pattern.
|
|
// Try wrapping the expression in 'const ( ... )' instead.
|
|
// case const -0: // Error
|
|
// ^
|
|
//
|
|
// pkg/front_end/testcases/patterns/const_patterns.dart:65:18: Error: The expression can't be prefixed by 'const' to form a constant pattern.
|
|
// Try wrapping the expression in 'const ( ... )' instead.
|
|
// case const 'foo': // Error
|
|
// ^^^^^
|
|
//
|
|
// pkg/front_end/testcases/patterns/const_patterns.dart:66:18: Error: The expression can't be prefixed by 'const' to form a constant pattern.
|
|
// Try wrapping the expression in 'const ( ... )' instead.
|
|
// case const #a: // Error
|
|
// ^
|
|
//
|
|
// pkg/front_end/testcases/patterns/const_patterns.dart:67:18: Error: The expression can't be prefixed by 'const' to form a constant pattern.
|
|
// Try wrapping the expression in 'const ( ... )' instead.
|
|
// case const value: // Error
|
|
// ^^^^^
|
|
//
|
|
// pkg/front_end/testcases/patterns/const_patterns.dart:68:18: Error: The expression can't be prefixed by 'const' to form a constant pattern.
|
|
// Try wrapping the expression in 'const ( ... )' instead.
|
|
// case const local: // Error
|
|
// ^^^^^
|
|
//
|
|
// pkg/front_end/testcases/patterns/const_patterns.dart:69:25: Error: The expression can't be prefixed by 'const' to form a constant pattern.
|
|
// Try wrapping the expression in 'const ( ... )' instead.
|
|
// case const prefix.value: // Error
|
|
// ^^^^^
|
|
//
|
|
// pkg/front_end/testcases/patterns/const_patterns.dart:70:18: Error: The expression can't be prefixed by 'const' to form a constant pattern.
|
|
// Try wrapping the expression in 'const ( ... )' instead.
|
|
// case const -prefix.value: // Error
|
|
// ^
|
|
//
|
|
// pkg/front_end/testcases/patterns/const_patterns.dart:71:31: Error: The expression can't be prefixed by 'const' to form a constant pattern.
|
|
// Try wrapping the expression in 'const ( ... )' instead.
|
|
// case const prefix.Class.named: // Error
|
|
// ^^^^^
|
|
//
|
|
// pkg/front_end/testcases/patterns/const_patterns.dart:72:18: 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.dart:73:23: Error: A function expression can't have a name.
|
|
// case const void fun() {}: // Error
|
|
// ^^^
|
|
//
|
|
// pkg/front_end/testcases/patterns/const_patterns.dart:74:18: Error: `assert` can't be used as an expression.
|
|
// case const assert(false): // Error
|
|
// ^^^^^^
|
|
//
|
|
// pkg/front_end/testcases/patterns/const_patterns.dart:75:26: Error: Not a constant expression.
|
|
// case const switch (o) { _ => true }: // Error
|
|
// ^
|
|
//
|
|
// pkg/front_end/testcases/patterns/const_patterns.dart:77:18: Error: The unary operator ! is not supported as a constant pattern.
|
|
// Try wrapping the expression in 'const ( ... )'.
|
|
// case const !false: // Error
|
|
// ^
|
|
//
|
|
// pkg/front_end/testcases/patterns/const_patterns.dart:78:18: Error: The unary operator ~ is not supported as a constant pattern.
|
|
// Try wrapping the expression in 'const ( ... )'.
|
|
// case const ~0: // Error
|
|
// ^
|
|
//
|
|
// pkg/front_end/testcases/patterns/const_patterns.dart:79:20: Error: Not a constant expression.
|
|
// case const ++variable: // Error
|
|
// ^^^^^^^^
|
|
//
|
|
// pkg/front_end/testcases/patterns/const_patterns.dart:92:18: Error: Duplicate 'const' keyword in constant expression.
|
|
// Try removing one of the 'const' keywords.
|
|
// case const const Class(): // Error
|
|
// ^^^^^
|
|
//
|
|
// pkg/front_end/testcases/patterns/const_patterns.dart:93:18: Error: Duplicate 'const' keyword in constant expression.
|
|
// Try removing one of the 'const' keywords.
|
|
// case const const Class(0): // Error
|
|
// ^^^^^
|
|
//
|
|
// pkg/front_end/testcases/patterns/const_patterns.dart:94:18: Error: Duplicate 'const' keyword in constant expression.
|
|
// Try removing one of the 'const' keywords.
|
|
// case const const GenericClass(): // Error
|
|
// ^^^^^
|
|
//
|
|
// pkg/front_end/testcases/patterns/const_patterns.dart:95:18: Error: Duplicate 'const' keyword in constant expression.
|
|
// Try removing one of the 'const' keywords.
|
|
// case const const GenericClass(a: 0): // Error
|
|
// ^^^^^
|
|
//
|
|
// pkg/front_end/testcases/patterns/const_patterns.dart:96:18: Error: Duplicate 'const' keyword in constant expression.
|
|
// Try removing one of the 'const' keywords.
|
|
// case const const GenericClass<int>(): // Error
|
|
// ^^^^^
|
|
//
|
|
// pkg/front_end/testcases/patterns/const_patterns.dart:97:18: Error: Duplicate 'const' keyword in constant expression.
|
|
// Try removing one of the 'const' keywords.
|
|
// case const const GenericClass<int>(a: 0): // Error
|
|
// ^^^^^
|
|
//
|
|
// pkg/front_end/testcases/patterns/const_patterns.dart:98:18: Error: Duplicate 'const' keyword in constant expression.
|
|
// Try removing one of the 'const' keywords.
|
|
// case const const []: // Error
|
|
// ^^^^^
|
|
//
|
|
// pkg/front_end/testcases/patterns/const_patterns.dart:99:18: Error: Duplicate 'const' keyword in constant expression.
|
|
// Try removing one of the 'const' keywords.
|
|
// case const const <int>[]: // Error
|
|
// ^^^^^
|
|
//
|
|
// pkg/front_end/testcases/patterns/const_patterns.dart:100:18: Error: Duplicate 'const' keyword in constant expression.
|
|
// Try removing one of the 'const' keywords.
|
|
// case const const {}: // Error
|
|
// ^^^^^
|
|
//
|
|
// pkg/front_end/testcases/patterns/const_patterns.dart:101:18: Error: Duplicate 'const' keyword in constant expression.
|
|
// Try removing one of the 'const' keywords.
|
|
// case const const <int, String>{}: // Error
|
|
// ^^^^^
|
|
//
|
|
// pkg/front_end/testcases/patterns/const_patterns.dart:102:18: Error: New expression is not a constant expression.
|
|
// case const new Class(): // Error
|
|
// ^^^
|
|
//
|
|
// pkg/front_end/testcases/patterns/const_patterns.dart:103:12: Error: New expression is not a constant expression.
|
|
// case new Class(): // Error
|
|
// ^^^
|
|
//
|
|
// pkg/front_end/testcases/patterns/const_patterns.dart:104:18: Error: The empty record literal is not supported as a constant pattern.
|
|
// case const (): // Error
|
|
// ^
|
|
//
|
|
// pkg/front_end/testcases/patterns/const_patterns.dart:105:18: Error: Duplicate 'const' keyword in constant expression.
|
|
// Try removing one of the 'const' keywords.
|
|
// case const const (): // Error
|
|
// ^^^^^
|
|
//
|
|
// pkg/front_end/testcases/patterns/const_patterns.dart:111:24: Error: This expression is not supported as a constant pattern.
|
|
// Try wrapping the expression in 'const ( ... )'.
|
|
// case GenericClass<int>: // Error
|
|
// ^
|
|
//
|
|
// pkg/front_end/testcases/patterns/const_patterns.dart:112:31: Error: This expression is not supported as a constant pattern.
|
|
// Try wrapping the expression in 'const ( ... )'.
|
|
// case prefix.GenericClass<int>: // Error
|
|
// ^
|
|
//
|
|
// pkg/front_end/testcases/patterns/const_patterns.dart:113:24: Error: This expression is not supported as a constant pattern.
|
|
// Try wrapping the expression in 'const ( ... )'.
|
|
// case GenericClass<int>.new: // Error
|
|
// ^
|
|
//
|
|
// pkg/front_end/testcases/patterns/const_patterns.dart:114:31: Error: This expression is not supported as a constant pattern.
|
|
// Try wrapping the expression in 'const ( ... )'.
|
|
// case prefix.GenericClass<int>.new: // Error
|
|
// ^
|
|
//
|
|
// pkg/front_end/testcases/patterns/const_patterns.dart:115:30: Error: This expression is not supported as a constant pattern.
|
|
// Try wrapping the expression in 'const ( ... )'.
|
|
// case const GenericClass<int>: // Error
|
|
// ^
|
|
//
|
|
// pkg/front_end/testcases/patterns/const_patterns.dart:116:37: Error: This expression is not supported as a constant pattern.
|
|
// Try wrapping the expression in 'const ( ... )'.
|
|
// case const prefix.GenericClass<int>: // Error
|
|
// ^
|
|
//
|
|
// pkg/front_end/testcases/patterns/const_patterns.dart:24:12: Error: Not a constant expression.
|
|
// case this: // Error
|
|
// ^
|
|
//
|
|
// pkg/front_end/testcases/patterns/const_patterns.dart:25:12: Error: Not a constant expression.
|
|
// case this(): // Error
|
|
// ^
|
|
//
|
|
// pkg/front_end/testcases/patterns/const_patterns.dart:54:12: Error: Not a constant expression.
|
|
// case switch (o) { _ => true }: // Error
|
|
// ^
|
|
//
|
|
// pkg/front_end/testcases/patterns/const_patterns.dart:55:12: Error: Not a constant expression.
|
|
// case await 0: // Error
|
|
// ^
|
|
//
|
|
// pkg/front_end/testcases/patterns/const_patterns.dart:73:18: Error: Not a constant expression.
|
|
// case const void fun() {}: // Error
|
|
// ^
|
|
//
|
|
// pkg/front_end/testcases/patterns/const_patterns.dart:75:18: Error: Not a constant expression.
|
|
// case const switch (o) { _ => true }: // Error
|
|
// ^
|
|
//
|
|
// pkg/front_end/testcases/patterns/const_patterns.dart:76:18: Error: Not a constant expression.
|
|
// case const await 0: // Error
|
|
// ^
|
|
//
|
|
// pkg/front_end/testcases/patterns/const_patterns.dart:102:22: Error: New expression is not a constant expression.
|
|
// case const new Class(): // Error
|
|
// ^
|
|
//
|
|
// pkg/front_end/testcases/patterns/const_patterns.dart:103:16: Error: New expression is not a constant expression.
|
|
// case new Class(): // Error
|
|
// ^
|
|
//
|
|
import self as self;
|
|
import "dart:core" as core;
|
|
|
|
import "org-dartlang-testcase:///const_patterns.dart" as prefix;
|
|
|
|
class Class extends core::Object /*hasConstConstructor*/ {
|
|
const constructor •([dynamic a = #C1]) → self::Class
|
|
: super core::Object::•()
|
|
;
|
|
const constructor named() → self::Class
|
|
: super core::Object::•()
|
|
;
|
|
method call() → dynamic {}
|
|
method test(dynamic o) → dynamic async /* futureValueType= dynamic */ {
|
|
dynamic variable = 0;
|
|
#L1:
|
|
{
|
|
void fun;
|
|
final dynamic #2#0 = o;
|
|
final const self::Class #2#5 = invalid-expression "Not a constant expression.";
|
|
final const dynamic #2#7 = invalid-expression "Not a constant expression.";
|
|
final const invalid-type #2#9 = invalid-expression "pkg/front_end/testcases/patterns/const_patterns.dart:26:12: Error: Method invocation is not a constant expression.
|
|
case super(): // Error
|
|
^^^^";
|
|
final const invalid-type #2#65 = invalid-expression "pkg/front_end/testcases/patterns/const_patterns.dart:53:12: Error: `assert` can't be used as an expression.
|
|
case assert(false): // Error
|
|
^^^^^^";
|
|
final const core::bool #2#67 = invalid-expression "Not a constant expression.";
|
|
final const core::int #2#69 = invalid-expression "Not a constant expression.";
|
|
final const invalid-type #2#75 = invalid-expression "pkg/front_end/testcases/patterns/const_patterns.dart:58:14: Error: Not a constant expression.
|
|
case ++variable: // Error
|
|
^^^^^^^^";
|
|
final const invalid-type #2#105 = invalid-expression "Not a constant expression.";
|
|
final const invalid-type #2#107 = invalid-expression "pkg/front_end/testcases/patterns/const_patterns.dart:74:18: Error: `assert` can't be used as an expression.
|
|
case const assert(false): // Error
|
|
^^^^^^";
|
|
final const core::bool #2#109 = invalid-expression "Not a constant expression.";
|
|
final const core::int #2#111 = invalid-expression "Not a constant expression.";
|
|
final const invalid-type #2#117 = invalid-expression "pkg/front_end/testcases/patterns/const_patterns.dart:79:20: Error: Not a constant expression.
|
|
case const ++variable: // Error
|
|
^^^^^^^^";
|
|
final const self::Class #2#163 = invalid-expression "New expression is not a constant expression.";
|
|
final const self::Class #2#165 = invalid-expression "New expression is not a constant expression.";
|
|
if(#C2 =={core::Object::==}{(core::Object) → core::bool} #2#0 || #2#0 == null || invalid-expression "Not a constant expression." =={core::Object::==}{(core::Object) → core::bool} #2#0 || invalid-expression "Not a constant expression." =={core::Object::==}{(core::Object) → core::bool} #2#0 || invalid-expression "pkg/front_end/testcases/patterns/const_patterns.dart:26:12: Error: Method invocation is not a constant expression.
|
|
case super(): // Error
|
|
^^^^" =={core::Object::==}{(core::Object) → core::bool} #2#0 || #C3 =={core::num::==}{(core::Object) → core::bool} #2#0 || #C4 =={core::num::==}{(core::Object) → core::bool} #2#0 || #C5 =={core::num::==}{(core::Object) → core::bool} #2#0 || #C6 =={core::num::==}{(core::Object) → core::bool} #2#0 || #C7 =={core::String::==}{(core::Object) → core::bool} #2#0 || #C8 =={core::String::==}{(core::Object) → core::bool} #2#0 || #C3 =={core::num::==}{(core::Object) → core::bool} #2#0 || (let final dynamic #t1 = #2#0! in #C3 =={core::num::==}{(core::Object) → core::bool} #2#0!) || (!(#2#0 == null) ?{core::bool} #C3 =={core::num::==}{(core::Object) → core::bool} #2#0 : false) || (let final dynamic #t2 = #2#0! in !(#2#0! == null) ?{core::bool} #C3 =={core::num::==}{(core::Object) → core::bool} #2#0! : false) || (!(#2#0 == null) ?{core::bool} let final dynamic #t3 = #2#0! in #C3 =={core::num::==}{(core::Object) → core::bool} #2#0! : false) || (let final dynamic #t4 = #2#0! in #C4 =={core::num::==}{(core::Object) → core::bool} #2#0!) || (!(#2#0 == null) ?{core::bool} #C4 =={core::num::==}{(core::Object) → core::bool} #2#0 : false) || (!(#2#0 == null) ?{core::bool} let final dynamic #t5 = #2#0! in #C4 =={core::num::==}{(core::Object) → core::bool} #2#0! : false) || (let final dynamic #t6 = #2#0! in !(#2#0! == null) ?{core::bool} #C4 =={core::num::==}{(core::Object) → core::bool} #2#0! : false) || (let final dynamic #t7 = #2#0 as{ForNonNullableByDefault} core::int in #C3 =={core::num::==}{(core::Object) → core::bool} #2#0 as{ForNonNullableByDefault} core::int) || #C4 =={core::num::==}{(core::Object) → core::bool} #2#0 || #C9 =={core::Object::==}{(core::Object) → core::bool} #2#0 || #C9 =={core::Object::==}{(core::Object) → core::bool} #2#0 || #C10 =={core::Object::==}{(core::Object) → core::bool} #2#0 || #C3 =={core::num::==}{(core::Object) → core::bool} #2#0 || #C4 =={core::num::==}{(core::Object) → core::bool} #2#0 || #C11 =={core::Object::==}{(core::Object) → core::bool} #2#0 || #C12 =={core::num::==}{(core::Object) → core::bool} #2#0 || #C13 =={core::num::==}{(core::Object) → core::bool} #2#0 || #2#0{core::int} is{ForNonNullableByDefault} void && (let final dynamic #t8 = fun = #2#0{core::int} in true)) {
|
|
{
|
|
() → Null {};
|
|
invalid-expression "pkg/front_end/testcases/patterns/const_patterns.dart:52:25: Error: This couldn't be parsed.
|
|
case void fun() {}: // Error
|
|
^";
|
|
break #L1;
|
|
}
|
|
}
|
|
else
|
|
if(invalid-expression "pkg/front_end/testcases/patterns/const_patterns.dart:53:12: Error: `assert` can't be used as an expression.
|
|
case assert(false): // Error
|
|
^^^^^^" =={core::Object::==}{(core::Object) → core::bool} #2#0 || invalid-expression "Not a constant expression." =={core::Object::==}{(core::Object) → core::bool} #2#0 || invalid-expression "Not a constant expression." =={core::num::==}{(core::Object) → core::bool} #2#0 || #C2 =={core::Object::==}{(core::Object) → core::bool} #2#0 || #C14 =={core::num::==}{(core::Object) → core::bool} #2#0 || invalid-expression "pkg/front_end/testcases/patterns/const_patterns.dart:58:14: Error: Not a constant expression.
|
|
case ++variable: // Error
|
|
^^^^^^^^" =={core::Object::==}{(core::Object) → core::bool} #2#0 || #C9 =={core::num::==}{(core::Object) → core::bool} #2#0 || #C9 =={core::num::==}{(core::Object) → core::bool} #2#0 || #C15 =={core::num::==}{(core::Object) → core::bool} #2#0 || #C2 =={core::Object::==}{(core::Object) → core::bool} #2#0 || #2#0 == null || #C9 =={core::num::==}{(core::Object) → core::bool} #2#0 || #C7 =={core::String::==}{(core::Object) → core::bool} #2#0 || #C16 =={core::Symbol::==}{(core::Object) → core::bool} #2#0 || #C3 =={core::num::==}{(core::Object) → core::bool} #2#0 || #C9 =={core::Object::==}{(core::Object) → core::bool} #2#0 || #C3 =={core::num::==}{(core::Object) → core::bool} #2#0 || #C4 =={core::num::==}{(core::Object) → core::bool} #2#0 || #C11 =={core::Object::==}{(core::Object) → core::bool} #2#0 || #C12 =={core::num::==}{(core::Object) → core::bool} #2#0 || invalid-expression "Not a constant expression." =={core::Object::==}{(core::Object) → core::bool} #2#0 || invalid-expression "pkg/front_end/testcases/patterns/const_patterns.dart:74:18: Error: `assert` can't be used as an expression.
|
|
case const assert(false): // Error
|
|
^^^^^^" =={core::Object::==}{(core::Object) → core::bool} #2#0 || invalid-expression "Not a constant expression." =={core::Object::==}{(core::Object) → core::bool} #2#0 || invalid-expression "Not a constant expression." =={core::num::==}{(core::Object) → core::bool} #2#0 || #C2 =={core::Object::==}{(core::Object) → core::bool} #2#0 || #C14 =={core::num::==}{(core::Object) → core::bool} #2#0 || invalid-expression "pkg/front_end/testcases/patterns/const_patterns.dart:79:20: Error: Not a constant expression.
|
|
case const ++variable: // Error
|
|
^^^^^^^^" =={core::Object::==}{(core::Object) → core::bool} #2#0 || #C17 =={core::Object::==}{(core::Object) → core::bool} #2#0 || #C17 =={core::Object::==}{(core::Object) → core::bool} #2#0 || #C18 =={core::Object::==}{(core::Object) → core::bool} #2#0 || #C18 =={core::Object::==}{(core::Object) → core::bool} #2#0 || #C19 =={core::Object::==}{(core::Object) → core::bool} #2#0 || #C19 =={core::Object::==}{(core::Object) → core::bool} #2#0 || #C19 =={core::Object::==}{(core::Object) → core::bool} #2#0 || #C19 =={core::Object::==}{(core::Object) → core::bool} #2#0 || #C20 =={core::List::==}{(core::Object) → core::bool} #2#0 || #C21 =={core::List::==}{(core::Object) → core::bool} #2#0 || #C22 =={core::Object::==}{(core::Object) → core::bool} #2#0 || #C23 =={core::Object::==}{(core::Object) → core::bool} #2#0 || #C17 =={core::Object::==}{(core::Object) → core::bool} #2#0 || #C17 =={core::Object::==}{(core::Object) → core::bool} #2#0 || #C18 =={core::Object::==}{(core::Object) → core::bool} #2#0 || #C18 =={core::Object::==}{(core::Object) → core::bool} #2#0 || #C19 =={core::Object::==}{(core::Object) → core::bool} #2#0 || #C19 =={core::Object::==}{(core::Object) → core::bool} #2#0 || #C20 =={core::List::==}{(core::Object) → core::bool} #2#0 || #C21 =={core::List::==}{(core::Object) → core::bool} #2#0 || #C22 =={core::Object::==}{(core::Object) → core::bool} #2#0 || #C23 =={core::Object::==}{(core::Object) → core::bool} #2#0 || invalid-expression "New expression is not a constant expression." =={core::Object::==}{(core::Object) → core::bool} #2#0 || invalid-expression "New expression is not a constant expression." =={core::Object::==}{(core::Object) → core::bool} #2#0 || #C24 =={core::Object::==}{(core::Object) → core::bool} #2#0 || #C24 =={core::Object::==}{(core::Object) → core::bool} #2#0 || #C25 =={core::num::==}{(core::Object) → core::bool} #2#0 || #C14 =={core::num::==}{(core::Object) → core::bool} #2#0 || #C3 =={core::num::==}{(core::Object) → core::bool} #2#0 || #C4 =={core::num::==}{(core::Object) → core::bool} #2#0 || #C12 =={core::num::==}{(core::Object) → core::bool} #2#0 || #C26 =={core::Type::==}{(core::Object) → core::bool} #2#0 || #C26 =={core::Type::==}{(core::Object) → core::bool} #2#0 || #C28 =={core::Object::==}{(core::Object) → core::bool} #2#0 || #C28 =={core::Object::==}{(core::Object) → core::bool} #2#0 || #C26 =={core::Type::==}{(core::Object) → core::bool} #2#0 || #C26 =={core::Type::==}{(core::Object) → core::bool} #2#0 || #C26 =={core::Type::==}{(core::Object) → core::bool} #2#0 || #C26 =={core::Type::==}{(core::Object) → core::bool} #2#0 || #C28 =={core::Object::==}{(core::Object) → core::bool} #2#0 || #C28 =={core::Object::==}{(core::Object) → core::bool} #2#0) {
|
|
{
|
|
core::print(0);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
class GenericClass<T extends core::Object? = dynamic> extends core::Object /*hasConstConstructor*/ {
|
|
const constructor •({dynamic a = #C1}) → self::GenericClass<self::GenericClass::T%>
|
|
: super core::Object::•()
|
|
;
|
|
}
|
|
static const field core::int value = #C3;
|
|
static method func() → void {}
|
|
|
|
constants {
|
|
#C1 = null
|
|
#C2 = true
|
|
#C3 = 42
|
|
#C4 = -42
|
|
#C5 = 42.5
|
|
#C6 = -42.5
|
|
#C7 = "foo"
|
|
#C8 = "foobar"
|
|
#C9 = 0
|
|
#C10 = static-tearoff self::func
|
|
#C11 = constructor-tearoff self::Class::named
|
|
#C12 = 3
|
|
#C13 = 2
|
|
#C14 = -1
|
|
#C15 = 0.5
|
|
#C16 = #a
|
|
#C17 = self::Class {}
|
|
#C18 = self::GenericClass<dynamic> {}
|
|
#C19 = self::GenericClass<core::int*> {}
|
|
#C20 = <dynamic>[]
|
|
#C21 = <core::int*>[]
|
|
#C22 = <dynamic, dynamic>{}
|
|
#C23 = <core::int*, core::String*>{}
|
|
#C24 = ()
|
|
#C25 = 1
|
|
#C26 = TypeLiteralConstant(self::GenericClass<core::int*>*)
|
|
#C27 = constructor-tearoff self::GenericClass::•
|
|
#C28 = instantiation #C27 <core::int*>
|
|
}
|
|
|
|
|
|
Constructor coverage from constants:
|
|
org-dartlang-testcase:///const_patterns.dart:
|
|
- Class. (from org-dartlang-testcase:///const_patterns.dart:12:9)
|
|
- Object. (from org-dartlang-sdk:///sdk/lib/core/object.dart)
|
|
- GenericClass. (from org-dartlang-testcase:///const_patterns.dart:127:9)
|