Reformat tests/language/v-z* using 3.8 style.

Change-Id: I781aabc6acc4f0341659380ed6cd169d66edce4e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/425346
Commit-Queue: Lasse Nielsen <lrn@google.com>
Auto-Submit: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Lasse Nielsen <lrn@google.com>
This commit is contained in:
Robert Nystrom
2025-05-02 04:14:03 -07:00
committed by Commit Queue
parent d3904f5a54
commit 33798260d6
66 changed files with 1155 additions and 1334 deletions
@@ -9,6 +9,7 @@ import 'value_class_support_lib.dart';
@valueClass
class Animal {
int numberOfLegs;
//^
// [cfe] unspecified
// ^^^^^^^^^^^^
// [analyzer] COMPILE_TIME_ERROR.NOT_INITIALIZED_NON_NULLABLE_INSTANCE_FIELD
// [cfe] Field 'numberOfLegs' should be initialized because its type 'int' doesn't allow null.
}
@@ -9,15 +9,8 @@
main() {
const elems = const [
const [
1,
2.0,
true,
false,
0xffffffffff,
],
const [1, 2.0, true, false, 0xffffffffff],
"a",
"b"
"b",
];
}
@@ -6,21 +6,21 @@
main() {
const elems = const [
// ^^^^^
// [analyzer] COMPILE_TIME_ERROR.RECURSIVE_COMPILE_TIME_CONSTANT
// ^^^^^
// [analyzer] COMPILE_TIME_ERROR.RECURSIVE_COMPILE_TIME_CONSTANT
const [
1,
2.0,
true,
false,
0xffffffffff,
elems
// ^^^^^
// [analyzer] COMPILE_TIME_ERROR.REFERENCED_BEFORE_DECLARATION
// [cfe] Local variable 'elems' can't be referenced before it is declared.
// [cfe] Undefined name 'elems'.
elems,
// [error column 7, length 5]
// [analyzer] COMPILE_TIME_ERROR.REFERENCED_BEFORE_DECLARATION
// [cfe] Local variable 'elems' can't be referenced before it is declared.
// [cfe] Undefined name 'elems'.
],
"a",
"b"
"b",
];
}
@@ -13,9 +13,7 @@ main() {
if (n == 0) {
return 0;
} else {
return 1
;
return 1;
}
};
foo(1);
@@ -10,16 +10,14 @@ main() {
if (n == 0) {
return 0;
} else {
return 1
+ foo(n - 1)
//^^^
// [analyzer] COMPILE_TIME_ERROR.REFERENCED_BEFORE_DECLARATION
// [cfe] Local variable 'foo' can't be referenced before it is declared.
// [cfe] Method not found: 'foo'.
;
return 1 + foo(n - 1);
// ^^^
// [analyzer] COMPILE_TIME_ERROR.REFERENCED_BEFORE_DECLARATION
// [cfe] Local variable 'foo' can't be referenced before it is declared.
// [cfe] Method not found: 'foo'.
}
};
foo(1);
//^
// [cfe] Method not found: 'foo'.
// [error column 3]
// [cfe] Method not found: 'foo'.
}
@@ -7,7 +7,6 @@
class Repeated {
var a = '', b = 'Something';
}
main() {}
@@ -11,35 +11,15 @@ class A {
}
class B extends A {
B.c1()
: super.foo
()
;
B.c1() : super.foo();
B.foo();
B.c2()
: this.foo
B.c2() : this.foo();
()
;
B.c3()
: super
()
;
B.c3() : super();
B();
B.c4()
: this
()
;
B.c4() : this();
}
main() {
@@ -17,12 +17,11 @@ class B extends A {
B.c2() : this.foo;
// ^^^^
// [analyzer] COMPILE_TIME_ERROR.INVALID_REFERENCE_TO_THIS
// [cfe] Can't access 'this' in a field initializer.
// ^^^^
// [analyzer] SYNTACTIC_ERROR.MISSING_ASSIGNMENT_IN_INITIALIZER
// [cfe] Expected an assignment after the field name.
// ^^^^^^^^
// [analyzer] COMPILE_TIME_ERROR.INITIALIZER_FOR_NON_EXISTENT_FIELD
// [cfe] Can't access 'this' in a field initializer.
// [cfe] Expected an assignment after the field name.
// ^^^
// [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER
@@ -39,15 +38,12 @@ class B extends A {
B.c4() : this;
// ^^^^
// [analyzer] COMPILE_TIME_ERROR.INITIALIZER_FOR_NON_EXISTENT_FIELD
// [cfe] Expected an assignment after the field name.
// ^^^^
// [analyzer] COMPILE_TIME_ERROR.INVALID_REFERENCE_TO_THIS
// ^^^^
// [analyzer] SYNTACTIC_ERROR.MISSING_ASSIGNMENT_IN_INITIALIZER
// [error line 39, column 16, length 0]
// [cfe] Expected '.' before this.
// [cfe] Expected an assignment after the field name.
// ^
// [analyzer] SYNTACTIC_ERROR.EXPECTED_TOKEN
// [cfe] Expected '.' before this.
// [cfe] Expected an identifier, but got ''.
}
@@ -17,119 +17,67 @@ class S {
class C extends S {
final int x;
C.cc01(int x)
: x = x,
super();
C.cc02(int x)
: x = x,
super.named();
C.cc01(int x) : x = x, super();
C.cc02(int x) : x = x, super.named();
C.cc03(this.x) : super();
C.cc04(this.x) : super.named();
C.cc05(int x)
: x = x,
assert(x == x),
super();
C.cc06(int x)
: x = x,
assert(x == x),
super.named();
C.cc07(this.x)
: assert(x == x),
super();
C.cc08(this.x)
: assert(x == x),
super.named();
C.cc05(int x) : x = x, assert(x == x), super();
C.cc06(int x) : x = x, assert(x == x), super.named();
C.cc07(this.x) : assert(x == x), super();
C.cc08(this.x) : assert(x == x), super.named();
C.cc09(int x)
: //
x = x;
: //
x = x;
C.cc10(int x)
: //
x = x;
: //
x = x;
C.cc11(this.x)
: //
assert(x == x);
: //
assert(x == x);
C.cc12(this.x)
: //
assert(x == x);
: //
assert(x == x);
C.cc13(int x)
: //
x = x,
assert(x == x);
: //
x = x,
assert(x == x);
C.cc14(int x)
: //
: //
x = x,
assert(x == x);
C.cc15(int x) : x = x, assert(x == x);
C.cc16(int x) : x = x, assert(x == x);
x = x,
assert(x == x);
C.cc15(int x)
: x = x,
assert(x == x);
C.cc16(int x)
: x = x,
assert(x == x);
const C.cc17(int x)
: x = x,
super();
const C.cc18(int x)
: x = x,
super.named();
const C.cc17(int x) : x = x, super();
const C.cc18(int x) : x = x, super.named();
const C.cc19(this.x) : super();
const C.cc20(this.x) : super.named();
const C.cc21(int x)
: x = x,
assert(x == x),
super();
const C.cc22(int x)
: x = x,
assert(x == x),
super.named();
const C.cc23(this.x)
: assert(x == x),
super();
const C.cc24(this.x)
: assert(x == x),
super.named();
const C.cc21(int x) : x = x, assert(x == x), super();
const C.cc22(int x) : x = x, assert(x == x), super.named();
const C.cc23(this.x) : assert(x == x), super();
const C.cc24(this.x) : assert(x == x), super.named();
const C.cc25(int x)
: //
x = x;
: //
x = x;
const C.cc26(int x)
: //
x = x;
: //
x = x;
const C.cc27(this.x)
: //
assert(x == x);
: //
assert(x == x);
const C.cc28(this.x)
: //
assert(x == x);
: //
assert(x == x);
const C.cc29(int x)
: //
x = x,
assert(x == x);
: //
x = x,
assert(x == x);
const C.cc30(int x)
: //
x = x,
assert(x == x);
const C.cc31(int x)
: x = x,
assert(x == x);
const C.cc32(int x)
: x = x,
assert(x == x);
: //
x = x,
assert(x == x);
const C.cc31(int x) : x = x, assert(x == x);
const C.cc32(int x) : x = x, assert(x == x);
}
main() {
@@ -14,191 +14,151 @@ class S {
class C extends S {
final int x;
C.cc01(int x)
: x = x,
super();
C.cc02(int x)
: x = x,
super.named();
C.cc01(int x) : x = x, super();
C.cc02(int x) : x = x, super.named();
C.cc03(this.x) : super();
C.cc04(this.x) : super.named();
C.cc05(int x)
: x = x,
assert(x == x),
super();
C.cc06(int x)
: x = x,
assert(x == x),
super.named();
C.cc07(this.x)
: assert(x == x),
super();
C.cc08(this.x)
: assert(x == x),
super.named();
C.cc05(int x) : x = x, assert(x == x), super();
C.cc06(int x) : x = x, assert(x == x), super.named();
C.cc07(this.x) : assert(x == x), super();
C.cc08(this.x) : assert(x == x), super.named();
C.cc09(int x)
: //
super(),
// ^^^^^
// [analyzer] COMPILE_TIME_ERROR.SUPER_INVOCATION_NOT_LAST
x = x;
//^
// [cfe] Can't have initializers after 'super'.
: super(),
//^^^^^
// [analyzer] COMPILE_TIME_ERROR.SUPER_INVOCATION_NOT_LAST
x = x;
// ^
// [cfe] Can't have initializers after 'super'.
C.cc10(int x)
: //
super.named(),
// ^^^^^
// [analyzer] COMPILE_TIME_ERROR.SUPER_INVOCATION_NOT_LAST
x = x;
//^
// [cfe] Can't have initializers after 'super'.
: super.named(),
//^^^^^
// [analyzer] COMPILE_TIME_ERROR.SUPER_INVOCATION_NOT_LAST
x = x;
// ^
// [cfe] Can't have initializers after 'super'.
C.cc11(this.x)
: //
super(),
// ^^^^^
// [analyzer] COMPILE_TIME_ERROR.SUPER_INVOCATION_NOT_LAST
assert(x == x);
// ^
// [cfe] Can't have initializers after 'super'.
: super(),
//^^^^^
// [analyzer] COMPILE_TIME_ERROR.SUPER_INVOCATION_NOT_LAST
assert(x == x);
// ^
// [cfe] Can't have initializers after 'super'.
C.cc12(this.x)
: //
super.named(),
// ^^^^^
// [analyzer] COMPILE_TIME_ERROR.SUPER_INVOCATION_NOT_LAST
assert(x == x);
// ^
// [cfe] Can't have initializers after 'super'.
: super.named(),
//^^^^^
// [analyzer] COMPILE_TIME_ERROR.SUPER_INVOCATION_NOT_LAST
assert(x == x);
// ^
// [cfe] Can't have initializers after 'super'.
C.cc13(int x)
: //
super(),
// ^^^^^
// [analyzer] COMPILE_TIME_ERROR.SUPER_INVOCATION_NOT_LAST
x = x,
//^
// [cfe] Can't have initializers after 'super'.
assert(x == x);
// ^
// [cfe] Can't have initializers after 'super'.
: super(),
//^^^^^
// [analyzer] COMPILE_TIME_ERROR.SUPER_INVOCATION_NOT_LAST
x = x,
//^
// [cfe] Can't have initializers after 'super'.
assert(x == x);
// ^
// [cfe] Can't have initializers after 'super'.
C.cc14(int x)
: //
super.named(),
// ^^^^^
// [analyzer] COMPILE_TIME_ERROR.SUPER_INVOCATION_NOT_LAST
x = x,
//^
// [cfe] Can't have initializers after 'super'.
assert(x == x);
// ^
// [cfe] Can't have initializers after 'super'.
: super.named(),
//^^^^^
// [analyzer] COMPILE_TIME_ERROR.SUPER_INVOCATION_NOT_LAST
x = x,
//^
// [cfe] Can't have initializers after 'super'.
assert(x == x);
// ^
// [cfe] Can't have initializers after 'super'.
C.cc15(int x)
: x = x,
super(),
// ^^^^^
// [analyzer] COMPILE_TIME_ERROR.SUPER_INVOCATION_NOT_LAST
assert(x == x);
// ^
// [cfe] Can't have initializers after 'super'.
: x = x,
super(),
// [error column 7, length 5]
// [analyzer] COMPILE_TIME_ERROR.SUPER_INVOCATION_NOT_LAST
assert(x == x);
// ^
// [cfe] Can't have initializers after 'super'.
C.cc16(int x)
: x = x,
super.named(),
// ^^^^^
// [analyzer] COMPILE_TIME_ERROR.SUPER_INVOCATION_NOT_LAST
assert(x == x);
// ^
// [cfe] Can't have initializers after 'super'.
: x = x,
super.named(),
// [error column 7, length 5]
// [analyzer] COMPILE_TIME_ERROR.SUPER_INVOCATION_NOT_LAST
assert(x == x);
// ^
// [cfe] Can't have initializers after 'super'.
const C.cc17(int x)
: x = x,
super();
const C.cc18(int x)
: x = x,
super.named();
const C.cc17(int x) : x = x, super();
const C.cc18(int x) : x = x, super.named();
const C.cc19(this.x) : super();
const C.cc20(this.x) : super.named();
const C.cc21(int x)
: x = x,
assert(x == x),
super();
const C.cc22(int x)
: x = x,
assert(x == x),
super.named();
const C.cc23(this.x)
: assert(x == x),
super();
const C.cc24(this.x)
: assert(x == x),
super.named();
const C.cc21(int x) : x = x, assert(x == x), super();
const C.cc22(int x) : x = x, assert(x == x), super.named();
const C.cc23(this.x) : assert(x == x), super();
const C.cc24(this.x) : assert(x == x), super.named();
const C.cc25(int x)
: //
super(),
// ^^^^^
// [analyzer] COMPILE_TIME_ERROR.SUPER_INVOCATION_NOT_LAST
x = x;
//^
// [cfe] Can't have initializers after 'super'.
: super(),
//^^^^^
// [analyzer] COMPILE_TIME_ERROR.SUPER_INVOCATION_NOT_LAST
x = x;
// ^
// [cfe] Can't have initializers after 'super'.
const C.cc26(int x)
: //
super.named(),
// ^^^^^
// [analyzer] COMPILE_TIME_ERROR.SUPER_INVOCATION_NOT_LAST
x = x;
//^
// [cfe] Can't have initializers after 'super'.
: super.named(),
//^^^^^
// [analyzer] COMPILE_TIME_ERROR.SUPER_INVOCATION_NOT_LAST
x = x;
// ^
// [cfe] Can't have initializers after 'super'.
const C.cc27(this.x)
: //
super(),
// ^^^^^
// [analyzer] COMPILE_TIME_ERROR.SUPER_INVOCATION_NOT_LAST
assert(x == x);
// ^
// [cfe] Can't have initializers after 'super'.
: super(),
//^^^^^
// [analyzer] COMPILE_TIME_ERROR.SUPER_INVOCATION_NOT_LAST
assert(x == x);
// ^
// [cfe] Can't have initializers after 'super'.
const C.cc28(this.x)
: //
super.named(),
// ^^^^^
// [analyzer] COMPILE_TIME_ERROR.SUPER_INVOCATION_NOT_LAST
assert(x == x);
// ^
// [cfe] Can't have initializers after 'super'.
: super.named(),
//^^^^^
// [analyzer] COMPILE_TIME_ERROR.SUPER_INVOCATION_NOT_LAST
assert(x == x);
// ^
// [cfe] Can't have initializers after 'super'.
const C.cc29(int x)
: //
super(),
// ^^^^^
// [analyzer] COMPILE_TIME_ERROR.SUPER_INVOCATION_NOT_LAST
x = x,
//^
// [cfe] Can't have initializers after 'super'.
assert(x == x);
// ^
// [cfe] Can't have initializers after 'super'.
: super(),
//^^^^^
// [analyzer] COMPILE_TIME_ERROR.SUPER_INVOCATION_NOT_LAST
x = x,
//^
// [cfe] Can't have initializers after 'super'.
assert(x == x);
// ^
// [cfe] Can't have initializers after 'super'.
const C.cc30(int x)
: //
super.named(),
// ^^^^^
// [analyzer] COMPILE_TIME_ERROR.SUPER_INVOCATION_NOT_LAST
x = x,
//^
// [cfe] Can't have initializers after 'super'.
assert(x == x);
// ^
// [cfe] Can't have initializers after 'super'.
: super.named(),
//^^^^^
// [analyzer] COMPILE_TIME_ERROR.SUPER_INVOCATION_NOT_LAST
x = x,
//^
// [cfe] Can't have initializers after 'super'.
assert(x == x);
// ^
// [cfe] Can't have initializers after 'super'.
const C.cc31(int x)
: x = x,
super(),
// ^^^^^
// [analyzer] COMPILE_TIME_ERROR.SUPER_INVOCATION_NOT_LAST
assert(x == x);
// ^
// [cfe] Can't have initializers after 'super'.
: x = x,
super(),
// [error column 7, length 5]
// [analyzer] COMPILE_TIME_ERROR.SUPER_INVOCATION_NOT_LAST
assert(x == x);
// ^
// [cfe] Can't have initializers after 'super'.
const C.cc32(int x)
: x = x,
super.named(),
// ^^^^^
// [analyzer] COMPILE_TIME_ERROR.SUPER_INVOCATION_NOT_LAST
assert(x == x);
// ^
// [cfe] Can't have initializers after 'super'.
: x = x,
super.named(),
// [error column 7, length 5]
// [analyzer] COMPILE_TIME_ERROR.SUPER_INVOCATION_NOT_LAST
assert(x == x);
// ^
// [cfe] Can't have initializers after 'super'.
}
main() {
@@ -21,7 +21,6 @@ class C {
void test1() {
use(f); // Refers to instance field f.
}
void test2() {
@@ -29,7 +28,6 @@ class C {
use(f); // Refers to instance field f.
}
if (true) {
var f = 1; // ok, shadows outer f and instance field f.
}
@@ -40,19 +38,10 @@ class C {
use(x); // Refers to top-level x.
use(y); // Refers to top-level y.
}
}
void test4() {
void Q() {
}
void Q() {}
}
test() {
@@ -65,12 +54,10 @@ class C {
void testTypeRef() {
String s = 'Can vegetarians eat animal crackers?';
}
void testLibPrefix() {
var pie = math.pi;
}
void noErrorsExpected() {
@@ -57,20 +57,23 @@ class C {
void test4() {
void Q() {
P(); // Refers to non-existing top-level function P
// ^
// [analyzer] COMPILE_TIME_ERROR.REFERENCED_BEFORE_DECLARATION
// [cfe] Local variable 'P' can't be referenced before it is declared.
// [cfe] The method 'P' isn't defined for the class 'C'.
// [error column 7, length 1]
// [analyzer] COMPILE_TIME_ERROR.REFERENCED_BEFORE_DECLARATION
// [cfe] Local variable 'P' can't be referenced before it is declared.
// [cfe] The method 'P' isn't defined for the class 'C'.
}
void P() {
Q();
}
Function f = () {x = f;};
// ^
// [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT
// [analyzer] COMPILE_TIME_ERROR.REFERENCED_BEFORE_DECLARATION
// [cfe] Local variable 'f' can't be referenced before it is declared.
Function f = () {
x = f;
// ^
// [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT
// [analyzer] COMPILE_TIME_ERROR.REFERENCED_BEFORE_DECLARATION
// [cfe] Local variable 'f' can't be referenced before it is declared.
};
}
test() {
@@ -83,9 +86,9 @@ class C {
void testTypeRef() {
String s = 'Can vegetarians eat animal crackers?';
//^^^^^^
// [analyzer] COMPILE_TIME_ERROR.REFERENCED_BEFORE_DECLARATION
// [cfe] Local variable 'String' can't be referenced before it is declared.
// [error column 3, length 6]
// [analyzer] COMPILE_TIME_ERROR.REFERENCED_BEFORE_DECLARATION
// [cfe] Local variable 'String' can't be referenced before it is declared.
var String = "I distinctly remember forgetting that.";
}
@@ -84,8 +84,7 @@ class D<in T> extends C<T> {
var a;
// ^
// [analyzer] COMPILE_TIME_ERROR.NOT_INITIALIZED_NON_NULLABLE_INSTANCE_FIELD
// [cfe] Can't use 'in' type variable 'T' in an 'out' position.
// ^
// [analyzer] COMPILE_TIME_ERROR.WRONG_TYPE_PARAMETER_VARIANCE_POSITION
// [cfe] Can't use 'in' type variable 'T' in an 'out' position.
// [cfe] Field 'a' should be initialized because its type 'T' doesn't allow null.
}
@@ -47,41 +47,41 @@ main() {
inferCovContra(Covariant<int>(), Contravariant<String>());
//^^^^^^^^^^^^^^
// [analyzer] COMPILE_TIME_ERROR.COULD_NOT_INFER
// [cfe] unspecified
// ^^^^^^^^^^^^^^^^^^^^^^^
// [analyzer] COMPILE_TIME_ERROR.ARGUMENT_TYPE_NOT_ASSIGNABLE
// [cfe] The argument type 'Contravariant<String>' can't be assigned to the parameter type 'Contravariant<int>'.
// String <: T <: int is not a valid constraint.
inferCovContra(Covariant<String>(), Contravariant<int>());
//^^^^^^^^^^^^^^
// [analyzer] COMPILE_TIME_ERROR.COULD_NOT_INFER
// [cfe] unspecified
// ^^^^^^^^^^^^^^^^^^^^
// [analyzer] COMPILE_TIME_ERROR.ARGUMENT_TYPE_NOT_ASSIGNABLE
// [cfe] The argument type 'Contravariant<int>' can't be assigned to the parameter type 'Contravariant<String>'.
// Middle <: T <: Lower is not a valid constraint
inferCovContra(Covariant<Middle>(), Contravariant<Lower>());
//^^^^^^^^^^^^^^
// [analyzer] COMPILE_TIME_ERROR.COULD_NOT_INFER
// [cfe] unspecified
// ^^^^^^^^^^^^^^^^^^^^^^
// [analyzer] COMPILE_TIME_ERROR.ARGUMENT_TYPE_NOT_ASSIGNABLE
// [cfe] The argument type 'Contravariant<Lower>' can't be assigned to the parameter type 'Contravariant<Middle>'.
// Upper <: T <: Lower is not a valid constraint
inferCovContra(Covariant<Upper>(), Contravariant<Lower>());
//^^^^^^^^^^^^^^
// [analyzer] COMPILE_TIME_ERROR.COULD_NOT_INFER
// [cfe] unspecified
// ^^^^^^^^^^^^^^^^^^^^^^
// [analyzer] COMPILE_TIME_ERROR.ARGUMENT_TYPE_NOT_ASSIGNABLE
// [cfe] The argument type 'Contravariant<Lower>' can't be assigned to the parameter type 'Contravariant<Upper>'.
// Upper <: T <: Middle is not a valid constraint
inferCovContra(Covariant<Upper>(), Contravariant<Middle>());
//^^^^^^^^^^^^^^
// [analyzer] COMPILE_TIME_ERROR.COULD_NOT_INFER
// [cfe] unspecified
// ^^^^^^^^^^^^^^^^^^^^^^^
// [analyzer] COMPILE_TIME_ERROR.ARGUMENT_TYPE_NOT_ASSIGNABLE
// [cfe] The argument type 'Contravariant<Middle>' can't be assigned to the parameter type 'Contravariant<Upper>'.
// Inference for Contrabound(...) produces Lower <: T <: Upper.
// Since T is contravariant, we choose Upper as the solution.
@@ -136,9 +136,7 @@ class S<in T> = Contravariant<T> with MCovariant<T>;
class T<in X> = Invariant<X> with MInvariant<X>;
// ^
// [cfe] Can't use 'in' type variable 'X' in an 'inout' position in supertype 'Invariant'.
// ^
// [cfe] Can't use 'in' type variable 'X' in an 'inout' position in supertype 'MInvariant'.
// ^
// [analyzer] COMPILE_TIME_ERROR.WRONG_EXPLICIT_TYPE_PARAMETER_VARIANCE_IN_SUPERINTERFACE
// ^
// [analyzer] COMPILE_TIME_ERROR.WRONG_EXPLICIT_TYPE_PARAMETER_VARIANCE_IN_SUPERINTERFACE
@@ -26,7 +26,9 @@ main() {
Expect.throws(() {
var array = new List<dynamic>.filled(
interestingLength ~/ elementLength, null);
interestingLength ~/ elementLength,
null,
);
print(array.first);
}, (e) => e is OutOfMemoryError);
}
@@ -85,7 +85,8 @@ main() {
final num doDeopt = (i < 120 ? 1 : 2.0);
final result = foo(3.0, doDeopt);
Expect.equals(
"v1: [1,hi], v2: [1.0,2.0], v3: [4.0,5.0], v4: [11.0, 12.0], sum: 9.0",
result);
"v1: [1,hi], v2: [1.0,2.0], v3: [4.0,5.0], v4: [11.0, 12.0], sum: 9.0",
result,
);
}
}
@@ -195,14 +195,15 @@ testCompound1() {
for (var i = 0; i < 100; i++) f(0.1);
Expect.equals(0.1, f(0.1));
Expect.equals(
0.1,
f(0.1, (val) {
Expect.isTrue(val is CompoundA);
Expect.isTrue(val.b is CompoundB);
Expect.isTrue(val.b.c is CompoundC);
Expect.isNull(val.b.c.root);
Expect.equals(0.1, val.b.c.d);
}));
0.1,
f(0.1, (val) {
Expect.isTrue(val is CompoundA);
Expect.isTrue(val.b is CompoundB);
Expect.isTrue(val.b.c is CompoundC);
Expect.isNull(val.b.c.root);
Expect.equals(0.1, val.b.c.d);
}),
);
}
testCompound2() {
@@ -218,14 +219,15 @@ testCompound2() {
for (var i = 0; i < 100; i++) f(0.1);
Expect.equals(0.1, f(0.1));
Expect.equals(
0.1,
f(0.1, (val) {
Expect.isTrue(val is CompoundA);
Expect.isTrue(val.b is CompoundB);
Expect.isTrue(val.b.c is CompoundC);
Expect.equals(val, val.b.c.root);
Expect.equals(0.1, val.b.c.d);
}));
0.1,
f(0.1, (val) {
Expect.isTrue(val is CompoundA);
Expect.isTrue(val.b is CompoundB);
Expect.isTrue(val.b.c is CompoundC);
Expect.equals(val, val.b.c.root);
Expect.equals(0.1, val.b.c.d);
}),
);
}
testCompound3() {
@@ -240,12 +242,13 @@ testCompound3() {
for (var i = 0; i < 100; i++) f(0.1);
Expect.equals(0.1, f(0.1));
Expect.equals(
0.1,
f(0.1, (val) {
Expect.isTrue(val is CompoundC);
Expect.equals(val, val.root);
Expect.equals(0.1, val.d);
}));
0.1,
f(0.1, (val) {
Expect.isTrue(val is CompoundC);
Expect.equals(val, val.root);
Expect.equals(0.1, val.d);
}),
);
}
testCompound4() {
@@ -263,12 +266,13 @@ testCompound4() {
for (var i = 0; i < 100; i++) f(1.0);
Expect.equals(1.0, f(1.0));
Expect.equals(
1.0,
f(1.0, (val) {
Expect.isTrue(val is CompoundC);
Expect.equals(val, val.root);
Expect.equals(11.0, val.d);
}));
1.0,
f(1.0, (val) {
Expect.isTrue(val is CompoundC);
Expect.equals(val, val.root);
Expect.equals(11.0, val.d);
}),
);
}
main() {
@@ -276,14 +280,19 @@ main() {
// Compute initial values.
final x0 = test1(c, 11.11, 22.22);
var fc = new Cx4(new Pointx4(
new Float32x4(1.0, 1.0, 1.0, 1.0), new Float32x4(1.0, 1.0, 1.0, 1.0)));
var fc = new Cx4(
new Pointx4(
new Float32x4(1.0, 1.0, 1.0, 1.0),
new Float32x4(1.0, 1.0, 1.0, 1.0),
),
);
final fx0 = test1x4(
fc,
new Float32x4(1.0, 1.0, 1.0, 1.0),
new Float32x4(1.0, 1.0, 1.0, 1.0),
new Float32x4(1.0, 1.0, 1.0, 1.0),
new Float32x4(1.0, 1.0, 1.0, 1.0));
fc,
new Float32x4(1.0, 1.0, 1.0, 1.0),
new Float32x4(1.0, 1.0, 1.0, 1.0),
new Float32x4(1.0, 1.0, 1.0, 1.0),
new Float32x4(1.0, 1.0, 1.0, 1.0),
);
final y0 = testForwardingThroughEffects(c, 11.11, 22.22);
final z0 = testIdentity(c.p);
@@ -291,11 +300,12 @@ main() {
for (var i = 0; i < 100; i++) {
test1(c, i.toDouble(), i.toDouble());
test1x4(
fc,
new Float32x4(1.0, 1.0, 1.0, 1.0),
new Float32x4(1.0, 1.0, 1.0, 1.0),
new Float32x4(1.0, 1.0, 1.0, 1.0),
new Float32x4(1.0, 1.0, 1.0, 1.0));
fc,
new Float32x4(1.0, 1.0, 1.0, 1.0),
new Float32x4(1.0, 1.0, 1.0, 1.0),
new Float32x4(1.0, 1.0, 1.0, 1.0),
new Float32x4(1.0, 1.0, 1.0, 1.0),
);
testForwardingThroughEffects(c, i.toDouble(), i.toDouble());
testIdentity(c.p);
foo2();
+32 -4
View File
@@ -37,10 +37,38 @@ main() {
0,
-1,
];
Expect.listEquals(
[255, 0, 255, 0, 255, 0, 255, 0, 255, 0, 11, 0, 0, 0], foo(x));
Expect.listEquals(
[255, 0, 1, 255, 0, 0, 255, 0, 255, 1, 11, 245, 0, 255], bar(x));
Expect.listEquals([
255,
0,
255,
0,
255,
0,
255,
0,
255,
0,
11,
0,
0,
0,
], foo(x));
Expect.listEquals([
255,
0,
1,
255,
0,
0,
255,
0,
255,
1,
11,
245,
0,
255,
], bar(x));
Expect.listEquals([-1, 0, 1, -1, 0, 0, -1, 0, -1, 1, 11, -11, 0, -1], baz(x));
// Hidden null.
+44 -162
View File
@@ -2,6 +2,8 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// Don't try to fit in 80 columns with this much nesting.
// dart format width=300
import 'package:expect/expect.dart';
// Stress tests on loop nesting depth. Make sure loop and induction
@@ -27,87 +29,27 @@ foo(List<int?> a) {
for (int i14 = i13 - 1; i14 <= i13 + 1; i14++)
for (int i15 = i14 - 1; i15 <= i14 + 1; i15++)
for (int i16 = i15 - 1; i16 <= i15 + 1; i16++)
for (int i17 = i16 - 1;
i17 <= i16 + 1;
i17++)
for (int i18 = i17 - 1;
i18 <= i17 + 1;
i18++)
for (int i19 = i18 - 1;
i19 <= i18 + 1;
i19++)
for (int i20 = i19 - 1;
i20 <= i19 + 1;
i20++)
for (int i21 = i20 - 1;
i21 <= i20 + 1;
i21++)
for (int i22 = i21 - 1;
i22 <= i21 + 1;
i22++)
for (int i23 = i22 - 1;
i23 <= i22 + 1;
i23++)
for (int i24 = i23 - 1;
i24 <= i23 + 1;
i24++)
for (int i25 = i24 - 1;
i25 <= i24 + 1;
i25++)
for (int i26 = i25 - 1;
i26 <= i25 + 1;
i26++)
for (int i27 = i26 - 1;
i27 <= i26 + 1;
i27++)
for (int i28 =
i27 - 1;
i28 <= i27 + 1;
i28++)
for (int i29 =
i28 - 1;
i29 <= i28 + 1;
i29++)
for (int i30 =
i29 - 1;
i30 <=
i29 + 1;
i30++)
for (int i31 =
i30 - 1;
i31 <=
i30 + 1;
i31++)
for (int i32 =
i31 -
1;
i32 <=
i31 +
1;
i32++)
for (int i33 =
i32 -
1;
i33 <=
i32 +
1;
i33++)
for (int i34 = i33 -
1;
i34 <=
i33 + 1;
i34++)
for (int i35 = i34 -
1;
i35 <=
i34 + 1;
i35++)
for (int i36 = i35 - 1;
i36 <= i35 + 1;
i36++)
for (int i37 = i36 - 1;
i37 <= i36 + 1;
i37++)
for (int i17 = i16 - 1; i17 <= i16 + 1; i17++)
for (int i18 = i17 - 1; i18 <= i17 + 1; i18++)
for (int i19 = i18 - 1; i19 <= i18 + 1; i19++)
for (int i20 = i19 - 1; i20 <= i19 + 1; i20++)
for (int i21 = i20 - 1; i21 <= i20 + 1; i21++)
for (int i22 = i21 - 1; i22 <= i21 + 1; i22++)
for (int i23 = i22 - 1; i23 <= i22 + 1; i23++)
for (int i24 = i23 - 1; i24 <= i23 + 1; i24++)
for (int i25 = i24 - 1; i25 <= i24 + 1; i25++)
for (int i26 = i25 - 1; i26 <= i25 + 1; i26++)
for (int i27 = i26 - 1; i27 <= i26 + 1; i27++)
for (int i28 = i27 - 1; i28 <= i27 + 1; i28++)
for (int i29 = i28 - 1; i29 <= i28 + 1; i29++)
for (int i30 = i29 - 1; i30 <= i29 + 1; i30++)
for (int i31 = i30 - 1; i31 <= i30 + 1; i31++)
for (int i32 = i31 - 1; i32 <= i31 + 1; i32++)
for (int i33 = i32 - 1; i33 <= i32 + 1; i33++)
for (int i34 = i33 - 1; i34 <= i33 + 1; i34++)
for (int i35 = i34 - 1; i35 <= i34 + 1; i35++)
for (int i36 = i35 - 1; i36 <= i35 + 1; i36++)
for (int i37 = i36 - 1; i37 <= i36 + 1; i37++)
for (int i38 = i37 - 1; i38 <= i37 + 1; i38++)
for (int i39 = i38 - 1; i39 <= i38 + 1; i39++)
for (int i40 = i39 - 1; i40 <= i39 + 1; i40++)
@@ -195,87 +137,27 @@ bar(List<int?> a) {
for (int i14 = i13 + 1; i14 >= i13 - 1; i14--)
for (int i15 = i14 + 1; i15 >= i14 - 1; i15--)
for (int i16 = i15 + 1; i16 >= i15 - 1; i16--)
for (int i17 = i16 + 1;
i17 >= i16 - 1;
i17--)
for (int i18 = i17 + 1;
i18 >= i17 - 1;
i18--)
for (int i19 = i18 + 1;
i19 >= i18 - 1;
i19--)
for (int i20 = i19 + 1;
i20 >= i19 - 1;
i20--)
for (int i21 = i20 + 1;
i21 >= i20 - 1;
i21--)
for (int i22 = i21 + 1;
i22 >= i21 - 1;
i22--)
for (int i23 = i22 + 1;
i23 >= i22 - 1;
i23--)
for (int i24 = i23 + 1;
i24 >= i23 - 1;
i24--)
for (int i25 = i24 + 1;
i25 >= i24 - 1;
i25--)
for (int i26 = i25 + 1;
i26 >= i25 - 1;
i26--)
for (int i27 = i26 + 1;
i27 >= i26 - 1;
i27--)
for (int i28 =
i27 + 1;
i28 >= i27 - 1;
i28--)
for (int i29 =
i28 + 1;
i29 >= i28 - 1;
i29--)
for (int i30 =
i29 + 1;
i30 >=
i29 - 1;
i30--)
for (int i31 =
i30 + 1;
i31 >=
i30 - 1;
i31--)
for (int i32 =
i31 +
1;
i32 >=
i31 -
1;
i32--)
for (int i33 =
i32 +
1;
i33 >=
i32 -
1;
i33--)
for (int i34 = i33 +
1;
i34 >=
i33 - 1;
i34--)
for (int i35 = i34 +
1;
i35 >=
i34 - 1;
i35--)
for (int i36 = i35 + 1;
i36 >= i35 - 1;
i36--)
for (int i37 = i36 + 1;
i37 >= i36 - 1;
i37--)
for (int i17 = i16 + 1; i17 >= i16 - 1; i17--)
for (int i18 = i17 + 1; i18 >= i17 - 1; i18--)
for (int i19 = i18 + 1; i19 >= i18 - 1; i19--)
for (int i20 = i19 + 1; i20 >= i19 - 1; i20--)
for (int i21 = i20 + 1; i21 >= i20 - 1; i21--)
for (int i22 = i21 + 1; i22 >= i21 - 1; i22--)
for (int i23 = i22 + 1; i23 >= i22 - 1; i23--)
for (int i24 = i23 + 1; i24 >= i23 - 1; i24--)
for (int i25 = i24 + 1; i25 >= i24 - 1; i25--)
for (int i26 = i25 + 1; i26 >= i25 - 1; i26--)
for (int i27 = i26 + 1; i27 >= i26 - 1; i27--)
for (int i28 = i27 + 1; i28 >= i27 - 1; i28--)
for (int i29 = i28 + 1; i29 >= i28 - 1; i29--)
for (int i30 = i29 + 1; i30 >= i29 - 1; i30--)
for (int i31 = i30 + 1; i31 >= i30 - 1; i31--)
for (int i32 = i31 + 1; i32 >= i31 - 1; i32--)
for (int i33 = i32 + 1; i33 >= i32 - 1; i33--)
for (int i34 = i33 + 1; i34 >= i33 - 1; i34--)
for (int i35 = i34 + 1; i35 >= i34 - 1; i35--)
for (int i36 = i35 + 1; i36 >= i35 - 1; i36--)
for (int i37 = i36 + 1; i37 >= i36 - 1; i37--)
for (int i38 = i37 + 1; i38 >= i37 - 1; i38--)
for (int i39 = i38 + 1; i39 >= i38 - 1; i39--)
for (int i40 = i39 + 1; i40 >= i39 - 1; i40--)
@@ -15,8 +15,9 @@ Int16List? foo0_0(int par4) {
return Int16List(40);
}
for (int loc0 = 0; loc0 < 31; loc0++) {
for (int loc1 in ((Uint8ClampedList.fromList(Uint8List(26)))
.sublist((11 >>> loc0), null))) {}
for (int loc1 in ((Uint8ClampedList.fromList(
Uint8List(26),
)).sublist((11 >>> loc0), null))) {}
}
return foo0_0(par4 + 1);
}
@@ -27,13 +27,9 @@ test1() async {
} catch (e, st) {
// st has foo,2,3 and not bar,2,3.
expect(
h.stringContainsInOrder(st.toString(), [
'foo3',
'foo2',
'foo',
'test1',
]),
isTrue);
h.stringContainsInOrder(st.toString(), ['foo3', 'foo2', 'foo', 'test1']),
isTrue,
);
expect(st.toString().contains('bar'), isFalse);
}
@@ -42,13 +38,9 @@ test1() async {
} catch (e, st) {
// st has bar,2,3 but not foo,2,3
expect(
h.stringContainsInOrder(st.toString(), [
'bar3',
'bar2',
'bar',
'test1',
]),
isTrue);
h.stringContainsInOrder(st.toString(), ['bar3', 'bar2', 'bar', 'test1']),
isTrue,
);
expect(st.toString().contains('foo'), isFalse);
}
}
@@ -64,13 +56,9 @@ test2() async {
} catch (e, st) {
// st has foo,2,3 but not bar,2,3
expect(
h.stringContainsInOrder(st.toString(), [
'foo3',
'foo2',
'foo',
'test2',
]),
isTrue);
h.stringContainsInOrder(st.toString(), ['foo3', 'foo2', 'foo', 'test2']),
isTrue,
);
expect(st.toString().contains('bar'), isFalse);
}
@@ -79,13 +67,9 @@ test2() async {
} catch (e, st) {
// st has bar,2,3 but not foo,2,3
expect(
h.stringContainsInOrder(st.toString(), [
'bar3',
'bar2',
'bar',
'test2',
]),
isTrue);
h.stringContainsInOrder(st.toString(), ['bar3', 'bar2', 'bar', 'test2']),
isTrue,
);
expect(st.toString().contains('foo'), isFalse);
}
}
@@ -33,14 +33,15 @@ main() async {
fail("Did not throw");
} catch (e, st) {
expect(
h.stringContainsInOrder(st.toString(), [
'thrower', '.dart:10', // no auto-format.
'generator', '.dart:19', // no auto-format.
'<asynchronous suspension>', // no auto-format.
'foo', '.dart', // no auto-format.
'main',
]),
isTrue);
h.stringContainsInOrder(st.toString(), [
'thrower', '.dart:10', // no auto-format.
'generator', '.dart:19', // no auto-format.
'<asynchronous suspension>', // no auto-format.
'foo', '.dart', // no auto-format.
'main',
]),
isTrue,
);
}
inner() async {
@@ -56,14 +57,15 @@ main() async {
await inner();
} catch (e, st) {
expect(
h.stringContainsInOrder(st.toString(), [
'thrower',
'main.<anonymous closure>.inner.deep',
'main.<anonymous closure>.inner',
'main',
'<asynchronous suspension>',
]),
isTrue);
h.stringContainsInOrder(st.toString(), [
'thrower',
'main.<anonymous closure>.inner.deep',
'main.<anonymous closure>.inner',
'main',
'<asynchronous suspension>',
]),
isTrue,
);
}
// Test for correct linkage.
@@ -71,11 +73,12 @@ main() async {
await thrower();
} catch (e, st) {
expect(
h.stringContainsInOrder(st.toString(), [
'thrower', '.dart:10', // no auto-format.
'main.<anonymous closure>', '.dart:71', // no auto-format.
]),
isTrue);
h.stringContainsInOrder(st.toString(), [
'thrower', '.dart:10', // no auto-format.
'main.<anonymous closure>', '.dart:73', // no auto-format.
]),
isTrue,
);
}
});
}
@@ -189,9 +189,7 @@ testPhiForwarding5(C c) {
class U {
var x, y;
U()
: x = 0,
y = 0;
U() : x = 0, y = 0;
}
testEqualPhisElimination() {
@@ -17,8 +17,9 @@ testClosureMessage() {
// The latter may happen if in --dwarf-stack-traces mode.
final possibleNames = ['testClosureMessage', '<optimized out>'];
Expect.containsAny(
possibleNames.map((s) => s + '.<anonymous closure>("bar")').toList(),
e.toString());
possibleNames.map((s) => s + '.<anonymous closure>("bar")').toList(),
e.toString(),
);
}
}
@@ -28,9 +29,7 @@ testFunctionMessage() {
try {
call_with_bar(noargs);
} catch (e) {
final expectedStrings = [
'Tried calling: noargs("bar")',
];
final expectedStrings = ['Tried calling: noargs("bar")'];
Expect.containsInOrder(expectedStrings, e.toString());
}
}
+13 -7
View File
@@ -74,9 +74,12 @@ List<int> test3(int n) {
// leaves the stack non-empty during a potential OSR.
@pragma('vm:never-inline')
List<int> test4(int n) {
var x = [10] +
z.check(42, bazz(), 'abc',
[more_bazz(), for (int i = 0; i < n; i++) bar(2 * i)]);
var x =
[10] +
z.check(42, bazz(), 'abc', [
more_bazz(),
for (int i = 0; i < n; i++) bar(2 * i),
]);
return x;
}
@@ -86,9 +89,12 @@ List<int> test4(int n) {
List<int> test5(int m, int n) {
List<int> x = [];
for (int k = 0; k < m; k++) {
x += [10] +
z.check(42, bazz(), 'abc',
[more_bazz(), for (int i = 0; i < n; i++) bar(2 * i)]);
x +=
[10] +
z.check(42, bazz(), 'abc', [
more_bazz(),
for (int i = 0; i < n; i++) bar(2 * i),
]);
}
return x;
}
@@ -96,7 +102,7 @@ List<int> test5(int m, int n) {
List<int> globalList = [
1,
for (int loc1 = 2; loc1 <= 100000; loc1++) loc1,
100001
100001,
];
main() {
+6 -3
View File
@@ -10,7 +10,10 @@ import "dart:mirrors";
main() {
var s = "string";
var im = reflect(s);
Expect.throwsNoSuchMethodError(() =>
im.invoke(MirrorSystem.getSymbol(
"_setAt", im.type.owner as LibraryMirror), [0, 65]));
Expect.throwsNoSuchMethodError(
() => im.invoke(
MirrorSystem.getSymbol("_setAt", im.type.owner as LibraryMirror),
[0, 65],
),
);
}
+3 -4
View File
@@ -18,10 +18,9 @@ bar(List<int> par1, double par2) {
bool foo(double par1) {
return (bar(
[81, 17],
((!(var1))
? double.maxFinite
: (var1 ? (80).floorToDouble() : par1))) ==
[81, 17],
((!(var1)) ? double.maxFinite : (var1 ? (80).floorToDouble() : par1)),
) ==
(((~(var2))).roundToDouble()).sign);
}
+11 -5
View File
@@ -9,12 +9,18 @@
import 'dart:async' show FutureOr;
typedef ComputeCallback<Q, R> = FutureOr<R> Function(Q message);
typedef _ComputeImpl = Future<R?> Function<Q, R>(
ComputeCallback<Q, R>? callback, Q? message,
{String debugLabel});
typedef _ComputeImpl =
Future<R?> Function<Q, R>(
ComputeCallback<Q, R>? callback,
Q? message, {
String debugLabel,
});
Future<R?> isolatesCompute<Q, R>(ComputeCallback<Q, R>? callback, Q? message,
{String? debugLabel}) async {
Future<R?> isolatesCompute<Q, R>(
ComputeCallback<Q, R>? callback,
Q? message, {
String? debugLabel,
}) async {
return null;
}
+7 -7
View File
@@ -15,10 +15,10 @@ List<List<List<List<int>>>> toNestedList() {
for (var i2 = 0; i2 < 2; i2++)
[
for (var i3 = 0; i3 < 2; i3++)
1000 * i0 + 100 * i1 + 10 * i2 + i3
]
]
]
1000 * i0 + 100 * i1 + 10 * i2 + i3,
],
],
],
];
return list;
}
@@ -32,7 +32,7 @@ const expectedList = [
[
[0100, 0101],
[0110, 0111],
]
],
],
[
[
@@ -42,8 +42,8 @@ const expectedList = [
[
[1100, 1101],
[1110, 1111],
]
]
],
],
];
void main() {
@@ -11,7 +11,8 @@ abstract class A<T> {
}
class B extends A<int> {
int Function(List<int> raw) get decode => (List<int> raw) => raw.first;
int Function(List<int> raw) get decode =>
(List<int> raw) => raw.first;
}
class C<T> {
@@ -10,6 +10,7 @@ import "package:expect/expect.dart";
class _ClassOnlyUsedAsTypeLiteral {}
void main() {
Expect
.isTrue((const [_ClassOnlyUsedAsTypeLiteral]).toString().startsWith('['));
Expect.isTrue(
(const [_ClassOnlyUsedAsTypeLiteral]).toString().startsWith('['),
);
}
@@ -10,8 +10,18 @@ import "package:expect/expect.dart";
List<int?> list = new List<int?>.filled(10, null);
List<int?> expected_values =
[null, 152, 168, 184, 200, 216, 232, 248, 264, 280];
List<int?> expected_values = [
null,
152,
168,
184,
200,
216,
232,
248,
264,
280,
];
int count = 0;
@@ -21,9 +21,7 @@ const uint8ListLength = 1000000;
void isolateEntry(SendPort sendPort) async {
final uint8list = Uint8List(uint8ListLength);
sendPort.send(Wrapper(
uint8list.buffer.asUint8List(0, uint8list.length),
));
sendPort.send(Wrapper(uint8list.buffer.asUint8List(0, uint8list.length)));
}
int readWrapperUint8ListView(Wrapper wrapper) {
+1 -1
View File
@@ -62,7 +62,7 @@ main() {
new Member(new BName("a")),
new Member(new BName("b")),
new Member(new BName("c")),
new Member(new BName("d"))
new Member(new BName("d")),
];
find(list, new AName());
+12 -9
View File
@@ -32,7 +32,7 @@ Map<int, String> var9 = {
99: 't',
49: 'Qu',
20: 'FujA\u2665',
47: ''
47: '',
};
String? foo2() {
@@ -55,22 +55,25 @@ String? foo2() {
: {
(var4++),
(var7[(false ? -87 : (++loc0))] %
(var7[((++loc0) * var4)] ~/ 73))
(var7[((++loc0) * var4)] ~/ 73)),
});
var0 = ((((-((((true ? var2 : false) ? (!(var3)) : true)
var0 =
((((-((((true ? var2 : false) ? (!(var3)) : true)
? var5
: ((0.38834735336907733 as dynamic) ??
0.8105736840461367)))) +
0.8105736840461367)))) +
(0.3752597438445757).abs()))
.isFinite
? {
(true ? 65 : (var3 ? (loc0--) : var4)),
var7[Float32x4.xxxx]
var7[Float32x4.xxxx],
}
: Set.identity());
var1 = (((true
? ({var7[var7[-9223372032559808513]]}).toSet()
: (Set.identity()).difference(var8!)) as dynamic) ??
var1 =
(((true
? ({var7[var7[-9223372032559808513]]}).toSet()
: (Set.identity()).difference(var8!))
as dynamic) ??
var8);
var9[Float32x4.zxyz] = '';
} catch (e) {
@@ -86,7 +89,7 @@ String? foo2() {
(var4--),
(-(ZLibOption.defaultWindowBits)),
(~((loc0--))),
(var4++)
(var4++),
];
}
}
@@ -26,7 +26,10 @@ import 'dart:typed_data';
Map<int, String> var0 = {
41: 'V\u2665Y\u2665#Xs',
for (int loc0 in {
if (true) for (int loc0 in {-2147483649}) -4294967167 else if (false) -1,
if (true)
for (int loc0 in {-2147483649}) -4294967167
else if (false)
-1,
-60,
-82,
-21,
@@ -40,7 +43,8 @@ Map<int, String> var0 = {
})
95: '',
5: 'z2\u2665e',
if (false) for (int loc0 in [-87, -2147483649, 0, 97, -53, 95]) 10: '#synP3',
if (false)
for (int loc0 in [-87, -2147483649, 0, 97, -53, 95]) 10: '#synP3',
22: ''
};
String var1 = ')LIpwG';
+28 -23
View File
@@ -24,22 +24,26 @@ import 'dart:typed_data';
Map<int, String> var0 = {
41: 'V\u2665Y\u2665#Xs',
for (int loc0 in {
if (true) for (int loc0 in {-2147483649}) -4294967167 else if (false) -1,
if (true)
for (int loc0 in {-2147483649}) -4294967167
else if (false)
-1,
-60,
-82,
-21,
for (int loc0 in [
-9223372036854771712,
for (int loc0 = 0; loc0 < 53; loc0++) 96
for (int loc0 = 0; loc0 < 53; loc0++) 96,
])
1,
-58,
77
77,
})
95: '',
5: 'z2\u2665e',
if (false) for (int loc0 in [-87, -2147483649, 0, 97, -53, 95]) 10: '#synP3',
22: ''
if (false)
for (int loc0 in [-87, -2147483649, 0, 97, -53, 95]) 10: '#synP3',
22: '',
};
String var1 = ')LIpwG';
double var2 = 0.30016980633333135;
@@ -60,14 +64,14 @@ Set<int> var9 = {
-26,
-38,
9223372032559808513,
60
60,
})
for (int loc1 in {
for (int loc1 in {19, 60}) -4294967280,
-17,
-62
-62,
}) ...{23, 11},
for (int loc0 = 0; loc0 < 30; loc0++) -44
for (int loc0 = 0; loc0 < 30; loc0++) -44,
};
Map<int, String> var10 = {
for (int loc0 in {
@@ -77,18 +81,18 @@ Map<int, String> var10 = {
if (true) 82,
...{76, 5, 9223372032559841279, 98, 58, 97, -127, 72},
for (int loc0 in [-97]) -14,
for (int loc0 = 0; loc0 < 21; loc0++) 88
for (int loc0 = 0; loc0 < 21; loc0++) 88,
},
-52,
for (int loc0 = 0; loc0 < 63; loc0++) ...{64, 0},
for (int loc0 = 0; loc0 < 67; loc0++) ...{67}
for (int loc0 = 0; loc0 < 67; loc0++) ...{67},
})
54: '',
41: 'cvokV0',
4: '9\u2665',
35: 'vRkv',
41: '\u2665',
63: 'Nu+u\u26659S'
63: 'Nu+u\u26659S',
};
mixin class X0 {}
@@ -108,18 +112,19 @@ main() {
}
try {
X1().foo1_1(
{
32,
-94,
-2147483649,
-43,
for (int loc0 in {56, -31}) -9223372032559775745,
53,
86,
4294967296
},
var4,
{1, 2});
{
32,
-94,
-2147483649,
-43,
for (int loc0 in {56, -31}) -9223372032559775745,
53,
86,
4294967296,
},
var4,
{1, 2},
);
} catch (exception, stackTrace) {
print('X1().foo1_1() throws');
}
+3 -2
View File
@@ -34,7 +34,8 @@ main() {
"a" == Uri.parse("\u2665");
}
print('fuzzvar8 runtime type: ${fuzzvar8.runtimeType}');
var x =
X1().foo1_0([for (int i = 0; i < 10; ++i) 0], bar(fuzzvar8, --fuzzvar1));
var x = X1().foo1_0([
for (int i = 0; i < 10; ++i) 0,
], bar(fuzzvar8, --fuzzvar1));
Expect.equals(1, x[0]);
}
+1 -1
View File
@@ -9,6 +9,6 @@
main() {
var x = [
[for (int i = 0; i < 20; ++i) i]
[for (int i = 0; i < 20; ++i) i],
];
}
+2 -1
View File
@@ -10,7 +10,8 @@
Map<int, Set<int>> var75 = {};
main() {
try {} catch (e, st) {} finally {
try {} catch (e, st) {
} finally {
print('before');
var75[42] = (false
? const {}
+15 -13
View File
@@ -56,19 +56,21 @@ class Box {
final int _value;
@pragma('vm:never-inline')
Box(
{int days = 0,
int hours = 0,
int minutes = 0,
int seconds = 0,
int milliseconds = 0,
int microseconds = 0})
: this._microseconds(1000 * 1000 * 60 * 60 * 24 * days +
1000 * 1000 * 60 * 60 * hours +
1000 * 1000 * 60 * minutes +
1000 * 1000 * seconds +
1000 * milliseconds +
microseconds);
Box({
int days = 0,
int hours = 0,
int minutes = 0,
int seconds = 0,
int milliseconds = 0,
int microseconds = 0,
}) : this._microseconds(
1000 * 1000 * 60 * 60 * 24 * days +
1000 * 1000 * 60 * 60 * hours +
1000 * 1000 * 60 * minutes +
1000 * 1000 * seconds +
1000 * milliseconds +
microseconds,
);
Box._microseconds(this._value);
+24 -6
View File
@@ -6,7 +6,10 @@
import "package:expect/expect.dart";
checkSecondFunction(
String expectedFileAndLine, int expectedColum, StackTrace stacktrace) {
String expectedFileAndLine,
int expectedColum,
StackTrace stacktrace,
) {
var topLine = stacktrace.toString().split("\n")[0];
int startPos = topLine.lastIndexOf("/");
int endPos = topLine.lastIndexOf(")");
@@ -31,7 +34,10 @@ class TypeTest {
Expect.isTrue(msg.contains("int")); // dstType
Expect.isTrue(msg.contains("String")); // srcType
checkSecondFunction(
"type_cast_vm_test.dart:26", 23, (error as dynamic).stackTrace);
"type_cast_vm_test.dart:29",
23,
(error as dynamic).stackTrace,
);
}
return result;
}
@@ -69,7 +75,10 @@ class TypeTest {
Expect.isTrue(msg.contains("int")); // dstType
Expect.isTrue(msg.contains("String")); // srcType
checkSecondFunction(
"type_cast_vm_test.dart:64", 25, (error as dynamic).stackTrace);
"type_cast_vm_test.dart:70",
25,
(error as dynamic).stackTrace,
);
}
return result;
}
@@ -89,7 +98,10 @@ class TypeTest {
Expect.isTrue(msg.contains("int")); // dstType
Expect.isTrue(msg.contains("String")); // srcType
checkSecondFunction(
"type_cast_vm_test.dart:80", 16, (error as dynamic).stackTrace);
"type_cast_vm_test.dart:89",
16,
(error as dynamic).stackTrace,
);
}
return result;
}
@@ -107,7 +119,10 @@ class TypeTest {
Expect.isTrue(msg.contains("int")); // dstType
Expect.isTrue(msg.contains("String")); // srcType
checkSecondFunction(
"type_cast_vm_test.dart:103", 13, (error as dynamic).stackTrace);
"type_cast_vm_test.dart:115",
13,
(error as dynamic).stackTrace,
);
}
return result;
}
@@ -126,7 +141,10 @@ class TypeTest {
Expect.isTrue(msg.contains("int")); // dstType
Expect.isTrue(msg.contains("() => Null")); // srcType
checkSecondFunction(
"type_cast_vm_test.dart:122", 17, (error as dynamic).stackTrace);
"type_cast_vm_test.dart:137",
17,
(error as dynamic).stackTrace,
);
}
return result;
}
@@ -17,7 +17,9 @@ maybeThrow(bool doThrow) {
@pragma('vm:never-inline')
run(action) {
try { action(); } catch(e) {}
try {
action();
} catch (e) {}
}
test(bool doThrow) {
@@ -25,12 +27,16 @@ test(bool doThrow) {
maybeThrow(doThrow);
} finally {
run(() {
doSomething(); // Should not crash here.
doSomething(); // Should not crash here.
});
}
}
main() {
try { test(true); } catch(e) {}
try { test(false); } catch(e) {}
try {
test(true);
} catch (e) {}
try {
test(false);
} catch (e) {}
}
@@ -12,25 +12,25 @@ FutureOr<void> fov;
void main() async {
await print('');
// ^
// [analyzer] unspecified
// ^^^^^
// [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT
// [cfe] This expression has type 'void' and can't be used.
await v;
// ^
// [analyzer] unspecified
// [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT
// [cfe] This expression has type 'void' and can't be used.
await vs[0];
// ^
// [analyzer] unspecified
// ^^^^^
// [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT
// ^
// [cfe] This expression has type 'void' and can't be used.
var v2 = vs[0];
await v2;
// ^
// [analyzer] unspecified
// ^^
// [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT
// [cfe] This expression has type 'void' and can't be used.
// A `FutureOr<void>` can be awaited.
@@ -17,7 +17,7 @@ main() {
// In the initialization and increment expressions of a for-loop,
// `for (e1; e2; e3) {..}`, `e1` and `e3` may have type void.
for (x;; x) {
for (x; ; x) {
break;
}
@@ -11,7 +11,7 @@ void main() {
// Testing that a block bodied function may not have an empty return
Future<FutureOr<void>> test() {
return;
//^^^^^^
// [analyzer] COMPILE_TIME_ERROR.RETURN_WITHOUT_VALUE
// [cfe] A value must be explicitly returned from a non-void function.
// [error column 3, length 6]
// [analyzer] COMPILE_TIME_ERROR.RETURN_WITHOUT_VALUE
// [cfe] A value must be explicitly returned from a non-void function.
}
@@ -47,5 +47,6 @@ FutureOr<FutureOr<void>> test6() {
// values, because `Future` is a subtype of `void`.
FutureOr<FutureOr<void>> test() {
return Future<Future<Future<void>>>.value(
Future<Future<void>>.value(Future<void>.value(null)));
Future<Future<void>>.value(Future<void>.value(null)),
);
}
File diff suppressed because it is too large Load Diff
@@ -246,13 +246,11 @@ class C14 {
// ^^^
// [context 14] 'bad' refers to a public property so it couldn't be promoted. See http://dart.dev/go/non-promo-public-field
// [context 63] 'bad' refers to a public property so it couldn't be promoted.
C14.assertInitializerCondition(C14 c)
: bad = c.bad!,
assert(c.bad);
// ^^^^^
// [analyzer 14] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE
// ^
// [cfe 63] A value of type 'bool?' can't be assigned to a variable of type 'bool' because 'bool?' is nullable and 'bool' isn't.
C14.assertInitializerCondition(C14 c) : bad = c.bad!, assert(c.bad);
// ^^^^^
// [analyzer 14] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE
// ^
// [cfe 63] A value of type 'bool?' can't be assigned to a variable of type 'bool' because 'bool?' is nullable and 'bool' isn't.
}
class C15 {
@@ -434,13 +432,11 @@ class C23 {
// [context 78] 'bad' refers to a public property so it couldn't be promoted.
final int x;
final int y;
C23.constructorInitializer(C23 c)
: x = c.bad!,
y = c.bad;
// ^^^^^
// [analyzer 29] COMPILE_TIME_ERROR.FIELD_INITIALIZER_NOT_ASSIGNABLE
// ^
// [cfe 78] A value of type 'int?' can't be assigned to a variable of type 'int' because 'int?' is nullable and 'int' isn't.
C23.constructorInitializer(C23 c) : x = c.bad!, y = c.bad;
// ^^^^^
// [analyzer 29] COMPILE_TIME_ERROR.FIELD_INITIALIZER_NOT_ASSIGNABLE
// ^
// [cfe 78] A value of type 'int?' can't be assigned to a variable of type 'int' because 'int?' is nullable and 'int' isn't.
}
class C24 {
@@ -674,13 +670,11 @@ class C34 {
class D34 extends C34 {
int other;
D34(C34 c)
: other = c.bad!,
super(c.bad);
// ^^^^^
// [analyzer 48] COMPILE_TIME_ERROR.ARGUMENT_TYPE_NOT_ASSIGNABLE
// ^
// [cfe 97] The argument type 'int?' can't be assigned to the parameter type 'int' because 'int?' is nullable and 'int' isn't.
D34(C34 c) : other = c.bad!, super(c.bad);
// ^^^^^
// [analyzer 48] COMPILE_TIME_ERROR.ARGUMENT_TYPE_NOT_ASSIGNABLE
// ^
// [cfe 97] The argument type 'int?' can't be assigned to the parameter type 'int' because 'int?' is nullable and 'int' isn't.
}
class C35 {
@@ -10,62 +10,62 @@ abstract class C {
direct_assignment(int? i, int? j) {
if (i == null) return;
i = j;
//^^^^^
// [context 6] Variable 'i' could not be promoted due to an assignment. See http://dart.dev/go/non-promo-write
// [context 10] Variable 'i' could not be promoted due to an assignment.
// [error column 3, length 5]
// [context 1] Variable 'i' could not be promoted due to an assignment. See http://dart.dev/go/non-promo-write
// [context 10] Variable 'i' could not be promoted due to an assignment.
i.isEven;
// ^^^^^^
// [analyzer 6] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE
// [cfe 10] Property 'isEven' cannot be accessed on 'int?' because it is potentially null.
//^^^^^^
// [analyzer 1] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE
// [cfe 10] Property 'isEven' cannot be accessed on 'int?' because it is potentially null.
}
compound_assignment(C? c, int i) {
if (c == null) return;
c += i;
//^^^^^^
// [context 7] Variable 'c' could not be promoted due to an assignment. See http://dart.dev/go/non-promo-write
// [context 11] Variable 'c' could not be promoted due to an assignment.
// [error column 3, length 6]
// [context 2] Variable 'c' could not be promoted due to an assignment. See http://dart.dev/go/non-promo-write
// [context 11] Variable 'c' could not be promoted due to an assignment.
c.cProperty;
// ^^^^^^^^^
// [analyzer 7] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE
// [cfe 11] Property 'cProperty' cannot be accessed on 'C?' because it is potentially null.
//^^^^^^^^^
// [analyzer 2] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE
// [cfe 11] Property 'cProperty' cannot be accessed on 'C?' because it is potentially null.
}
via_postfix_op(C? c) {
if (c == null) return;
c++;
//^^^
// [context 4] Variable 'c' could not be promoted due to an assignment. See http://dart.dev/go/non-promo-write
// [context 12] Variable 'c' could not be promoted due to an assignment.
// [error column 3, length 3]
// [context 3] Variable 'c' could not be promoted due to an assignment. See http://dart.dev/go/non-promo-write
// [context 12] Variable 'c' could not be promoted due to an assignment.
c.cProperty;
// ^^^^^^^^^
// [analyzer 4] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE
// [cfe 12] Property 'cProperty' cannot be accessed on 'C?' because it is potentially null.
//^^^^^^^^^
// [analyzer 3] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE
// [cfe 12] Property 'cProperty' cannot be accessed on 'C?' because it is potentially null.
}
via_prefix_op(C? c) {
if (c == null) return;
++c;
//^^^
// [context 9] Variable 'c' could not be promoted due to an assignment. See http://dart.dev/go/non-promo-write
// [error column 3, length 3]
// [context 4] Variable 'c' could not be promoted due to an assignment. See http://dart.dev/go/non-promo-write
//^
// [context 13] Variable 'c' could not be promoted due to an assignment.
c.cProperty;
// ^^^^^^^^^
// [analyzer 9] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE
// [cfe 13] Property 'cProperty' cannot be accessed on 'C?' because it is potentially null.
//^^^^^^^^^
// [analyzer 4] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE
// [cfe 13] Property 'cProperty' cannot be accessed on 'C?' because it is potentially null.
}
via_for_each_statement(int? i, List<int?> list) {
if (i == null) return;
for (i in list) {
// ^
// [context 3] Variable 'i' could not be promoted due to an assignment. See http://dart.dev/go/non-promo-write
// [context 5] Variable 'i' could not be promoted due to an assignment. See http://dart.dev/go/non-promo-write
// [context 14] Variable 'i' could not be promoted due to an assignment.
i.isEven;
// ^^^^^^
// [analyzer 3] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE
// [cfe 14] Property 'isEven' cannot be accessed on 'int?' because it is potentially null.
//^^^^^^
// [analyzer 5] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE
// [cfe 14] Property 'isEven' cannot be accessed on 'int?' because it is potentially null.
}
}
@@ -73,10 +73,10 @@ via_for_each_list_element(int? i, List<int?> list) {
if (i == null) return;
[for (i in list) i.isEven];
// ^
// [context 8] Variable 'i' could not be promoted due to an assignment. See http://dart.dev/go/non-promo-write
// [context 6] Variable 'i' could not be promoted due to an assignment. See http://dart.dev/go/non-promo-write
// [context 15] Variable 'i' could not be promoted due to an assignment.
// ^^^^^^
// [analyzer 8] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE
// [analyzer 6] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE
// [cfe 15] Property 'isEven' cannot be accessed on 'int?' because it is potentially null.
}
@@ -84,10 +84,10 @@ via_for_each_set_element(int? i, List<int?> list) {
if (i == null) return;
({for (i in list) i.isEven});
// ^
// [context 1] Variable 'i' could not be promoted due to an assignment. See http://dart.dev/go/non-promo-write
// [context 7] Variable 'i' could not be promoted due to an assignment. See http://dart.dev/go/non-promo-write
// [context 16] Variable 'i' could not be promoted due to an assignment.
// ^^^^^^
// [analyzer 1] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE
// [analyzer 7] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE
// [cfe 16] Property 'isEven' cannot be accessed on 'int?' because it is potentially null.
}
@@ -95,10 +95,10 @@ via_for_each_map_key(int? i, List<int?> list) {
if (i == null) return;
({for (i in list) i.isEven: null});
// ^
// [context 2] Variable 'i' could not be promoted due to an assignment. See http://dart.dev/go/non-promo-write
// [context 8] Variable 'i' could not be promoted due to an assignment. See http://dart.dev/go/non-promo-write
// [context 17] Variable 'i' could not be promoted due to an assignment.
// ^^^^^^
// [analyzer 2] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE
// [analyzer 8] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE
// [cfe 17] Property 'isEven' cannot be accessed on 'int?' because it is potentially null.
}
@@ -106,9 +106,9 @@ via_for_each_map_value(int? i, List<int?> list) {
if (i == null) return;
({for (i in list) null: i.isEven});
// ^
// [context 5] Variable 'i' could not be promoted due to an assignment. See http://dart.dev/go/non-promo-write
// [context 9] Variable 'i' could not be promoted due to an assignment. See http://dart.dev/go/non-promo-write
// [context 18] Variable 'i' could not be promoted due to an assignment.
// ^^^^^^
// [analyzer 5] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE
// [analyzer 9] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE
// [cfe 18] Property 'isEven' cannot be accessed on 'int?' because it is potentially null.
}
@@ -6,25 +6,25 @@ class C {
get_property_via_explicit_this() {
if (this.i == null) return;
this.i.isEven;
// ^^^^^^
// [analyzer 1] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE
// [cfe 6] Property 'isEven' cannot be accessed on 'int?' because it is potentially null.
// ^^^^^^
// [analyzer 1] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE
// [cfe 6] Property 'isEven' cannot be accessed on 'int?' because it is potentially null.
}
get_property_via_explicit_this_parenthesized() {
if ((this).i == null) return;
(this).i.isEven;
// ^^^^^^
// [analyzer 2] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE
// [cfe 7] Property 'isEven' cannot be accessed on 'int?' because it is potentially null.
// ^^^^^^
// [analyzer 2] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE
// [cfe 7] Property 'isEven' cannot be accessed on 'int?' because it is potentially null.
}
get_property_by_implicit_this() {
if (i == null) return;
i.isEven;
// ^^^^^^
// [analyzer 3] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE
// [cfe 8] Property 'isEven' cannot be accessed on 'int?' because it is potentially null.
//^^^^^^
// [analyzer 3] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE
// [cfe 8] Property 'isEven' cannot be accessed on 'int?' because it is potentially null.
}
}
@@ -48,18 +48,18 @@ class D extends C {
get_property_by_implicit_super() {
if (i == null) return;
i.isEven;
// ^^^^^^
// [analyzer 4] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE
// [cfe 9] Property 'isEven' cannot be accessed on 'int?' because it is potentially null.
//^^^^^^
// [analyzer 4] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE
// [cfe 9] Property 'isEven' cannot be accessed on 'int?' because it is potentially null.
}
}
get_property_via_prefixed_identifier(C c) {
if (c.i == null) return;
c.i.isEven;
// ^^^^^^
// [analyzer 5] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE
// [cfe 10] Property 'isEven' cannot be accessed on 'int?' because it is potentially null.
// ^^^^^^
// [analyzer 5] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE
// [cfe 10] Property 'isEven' cannot be accessed on 'int?' because it is potentially null.
}
get_property_via_prefixed_identifier_mismatched_target(C c1, C c2) {
@@ -67,9 +67,9 @@ get_property_via_prefixed_identifier_mismatched_target(C c1, C c2) {
// to promote is on c1, but the property the user is accessing is on c2.
if (c1.i == null) return;
c2.i.isEven;
// ^^^^^^
// [analyzer] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE
// [cfe] Property 'isEven' cannot be accessed on 'int?' because it is potentially null.
// ^^^^^^
// [analyzer] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE
// [cfe] Property 'isEven' cannot be accessed on 'int?' because it is potentially null.
}
get_property_via_prefixed_identifier_mismatched_property(C c) {
@@ -77,7 +77,7 @@ get_property_via_prefixed_identifier_mismatched_property(C c) {
// to promote is C.i, but the property the user is accessing is C.j.
if (c.i == null) return;
c.j.isEven;
// ^^^^^^
// [analyzer] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE
// [cfe] Property 'isEven' cannot be accessed on 'int?' because it is potentially null.
// ^^^^^^
// [analyzer] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE
// [cfe] Property 'isEven' cannot be accessed on 'int?' because it is potentially null.
}
@@ -22,25 +22,25 @@ class C {
get_field_via_explicit_this() {
if (this.i == null) return;
this.i.isEven;
// ^^^^^^
// [analyzer 1] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE
// [cfe 7] Property 'isEven' cannot be accessed on 'int?' because it is potentially null.
// ^^^^^^
// [analyzer 1] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE
// [cfe 7] Property 'isEven' cannot be accessed on 'int?' because it is potentially null.
}
get_field_via_explicit_this_parenthesized() {
if ((this).i == null) return;
(this).i.isEven;
// ^^^^^^
// [analyzer 2] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE
// [cfe 8] Property 'isEven' cannot be accessed on 'int?' because it is potentially null.
// ^^^^^^
// [analyzer 2] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE
// [cfe 8] Property 'isEven' cannot be accessed on 'int?' because it is potentially null.
}
get_field_by_implicit_this() {
if (i == null) return;
i.isEven;
// ^^^^^^
// [analyzer 3] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE
// [cfe 9] Property 'isEven' cannot be accessed on 'int?' because it is potentially null.
//^^^^^^
// [analyzer 3] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE
// [cfe 9] Property 'isEven' cannot be accessed on 'int?' because it is potentially null.
}
}
@@ -48,26 +48,26 @@ class D extends C {
get_field_via_explicit_super() {
if (super.i == null) return;
super.i.isEven;
// ^^^^^^
// [analyzer 4] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE
// [cfe 10] Property 'isEven' cannot be accessed on 'int?' because it is potentially null.
// ^^^^^^
// [analyzer 4] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE
// [cfe 10] Property 'isEven' cannot be accessed on 'int?' because it is potentially null.
}
get_field_by_implicit_super() {
if (i == null) return;
i.isEven;
// ^^^^^^
// [analyzer 5] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE
// [cfe 11] Property 'isEven' cannot be accessed on 'int?' because it is potentially null.
//^^^^^^
// [analyzer 5] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE
// [cfe 11] Property 'isEven' cannot be accessed on 'int?' because it is potentially null.
}
}
get_field_via_prefixed_identifier(C c) {
if (c.i == null) return;
c.i.isEven;
// ^^^^^^
// [analyzer 6] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE
// [cfe 12] Property 'isEven' cannot be accessed on 'int?' because it is potentially null.
// ^^^^^^
// [analyzer 6] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE
// [cfe 12] Property 'isEven' cannot be accessed on 'int?' because it is potentially null.
}
get_field_via_prefixed_identifier_mismatched_target(C c1, C c2) {
@@ -75,9 +75,9 @@ get_field_via_prefixed_identifier_mismatched_target(C c1, C c2) {
// to promote is on c1, but the property the user is accessing is on c2.
if (c1.i == null) return;
c2.i.isEven;
// ^^^^^^
// [analyzer] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE
// [cfe] Property 'isEven' cannot be accessed on 'int?' because it is potentially null.
// ^^^^^^
// [analyzer] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE
// [cfe] Property 'isEven' cannot be accessed on 'int?' because it is potentially null.
}
get_field_via_prefixed_identifier_mismatched_property(C c) {
@@ -85,7 +85,7 @@ get_field_via_prefixed_identifier_mismatched_property(C c) {
// to promote is C.i, but the property the user is accessing is C.j.
if (c.i == null) return;
c.j.isEven;
// ^^^^^^
// [analyzer] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE
// [cfe] Property 'isEven' cannot be accessed on 'int?' because it is potentially null.
// ^^^^^^
// [analyzer] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE
// [cfe] Property 'isEven' cannot be accessed on 'int?' because it is potentially null.
}
@@ -20,10 +20,10 @@ class C2 {
instance_method_invocation(C1 c) {
if (c.bad == null) return;
c.bad();
//^^^^^
// [analyzer 1] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE
// ^
// [cfe 7] Can't use an expression of type 'C2?' as a function because it's potentially null.
// [error column 3, length 5]
// [analyzer 1] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE
// ^
// [cfe 7] Can't use an expression of type 'C2?' as a function because it's potentially null.
}
class C3 {
@@ -51,10 +51,10 @@ extension_invocation_method(C3 c) {
c.ok();
if (c.bad == null) return;
c.bad();
//^^^^^
// [analyzer 2] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE
// ^
// [cfe 8] Can't use an expression of type 'C5?' as a function because it's potentially null.
// [error column 3, length 5]
// [analyzer 2] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE
// ^
// [cfe 8] Can't use an expression of type 'C5?' as a function because it's potentially null.
}
class C6 {
@@ -71,11 +71,11 @@ class C7 {
instance_getter_invocation(C6 c) {
if (c.bad == null) return;
c.bad();
//^^^^^
// [analyzer] COMPILE_TIME_ERROR.INVOCATION_OF_NON_FUNCTION_EXPRESSION
// [analyzer 3] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE
// ^
// [cfe 9] Can't use an expression of type 'C7?' as a function because it's potentially null.
// [error column 3, length 5]
// [analyzer] COMPILE_TIME_ERROR.INVOCATION_OF_NON_FUNCTION_EXPRESSION
// [analyzer 3] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE
// ^
// [cfe 9] Can't use an expression of type 'C7?' as a function because it's potentially null.
}
class C8 {
@@ -94,10 +94,10 @@ extension on C10 {
extension_invocation_getter(C8 c) {
if (c.bad == null) return;
c.bad();
//^^^^^
// [analyzer 4] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE
// ^
// [cfe 10] Can't use an expression of type 'C10?' as a function because it's potentially null.
// [error column 3, length 5]
// [analyzer 4] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE
// ^
// [cfe 10] Can't use an expression of type 'C10?' as a function because it's potentially null.
}
class C11 {
@@ -110,10 +110,10 @@ class C11 {
function_invocation(C11 c) {
if (c.bad == null) return;
c.bad();
//^^^^^
// [analyzer 5] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE
// ^
// [cfe 11] Can't use an expression of type 'void Function()?' as a function because it's potentially null.
// [error column 3, length 5]
// [analyzer 5] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE
// ^
// [cfe 11] Can't use an expression of type 'void Function()?' as a function because it's potentially null.
}
class C12 {
@@ -133,7 +133,7 @@ instance_field_invocation(C12 c) {
// Note: the CFE error message is misleading here. See
// https://github.com/dart-lang/sdk/issues/45552
c.bad.foo();
// ^^^
// [analyzer 6] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE
// [cfe 12] Can't use an expression of type 'C13?' as a function because it's potentially null.
// ^^^
// [analyzer 6] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE
// [cfe 12] Can't use an expression of type 'C13?' as a function because it's potentially null.
}
@@ -36,66 +36,66 @@ extension on int? {
property_get_of_variable(int? i, int? j) {
if (i == null) return;
i = j;
//^^^^^
// [context 1] Variable 'i' could not be promoted due to an assignment. See http://dart.dev/go/non-promo-write
// [context 8] Variable 'i' could not be promoted due to an assignment.
// [error column 3, length 5]
// [context 1] Variable 'i' could not be promoted due to an assignment. See http://dart.dev/go/non-promo-write
// [context 8] Variable 'i' could not be promoted due to an assignment.
i.isEven;
// ^^^^^^
// [analyzer 1] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE
// [cfe 8] Property 'isEven' cannot be accessed on 'int?' because it is potentially null.
//^^^^^^
// [analyzer 1] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE
// [cfe 8] Property 'isEven' cannot be accessed on 'int?' because it is potentially null.
}
extension_property_get_of_variable(int? i, int? j) {
if (i == null) return;
i = j;
//^^^^^
// [context 2] Variable 'i' could not be promoted due to an assignment. See http://dart.dev/go/non-promo-write
// [context 9] Variable 'i' could not be promoted due to an assignment.
// [error column 3, length 5]
// [context 2] Variable 'i' could not be promoted due to an assignment. See http://dart.dev/go/non-promo-write
// [context 9] Variable 'i' could not be promoted due to an assignment.
i.propertyOnNullableInt;
i.propertyOnNonNullInt;
// ^^^^^^^^^^^^^^^^^^^^
// [analyzer 2] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE
// [cfe 9] Property 'propertyOnNonNullInt' cannot be accessed on 'int?' because it is potentially null.
//^^^^^^^^^^^^^^^^^^^^
// [analyzer 2] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE
// [cfe 9] Property 'propertyOnNonNullInt' cannot be accessed on 'int?' because it is potentially null.
}
property_get_of_expression(C c) {
if (c.i == null) return;
c.i.isEven;
// ^^^^^^
// [analyzer 3] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE
// [cfe 10] Property 'isEven' cannot be accessed on 'int?' because it is potentially null.
// ^^^^^^
// [analyzer 3] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE
// [cfe 10] Property 'isEven' cannot be accessed on 'int?' because it is potentially null.
}
extension_property_get_of_expression(C c) {
if (c.i == null) return;
c.i.propertyOnNullableInt;
c.i.propertyOnNonNullInt;
// ^^^^^^^^^^^^^^^^^^^^
// [analyzer 4] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE
// [cfe 11] Property 'propertyOnNonNullInt' cannot be accessed on 'int?' because it is potentially null.
// ^^^^^^^^^^^^^^^^^^^^
// [analyzer 4] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE
// [cfe 11] Property 'propertyOnNonNullInt' cannot be accessed on 'int?' because it is potentially null.
}
method_invocation(C c) {
if (c.i == null) return;
c.i.abs();
// ^^^
// [analyzer 5] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE
// [cfe 12] Method 'abs' cannot be called on 'int?' because it is potentially null.
// ^^^
// [analyzer 5] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE
// [cfe 12] Method 'abs' cannot be called on 'int?' because it is potentially null.
}
extension_method_invocation(C c) {
if (c.i == null) return;
c.i.methodOnNullableInt();
c.i.methodOnNonNullInt();
// ^^^^^^^^^^^^^^^^^^
// [analyzer 6] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE
// [cfe 13] Method 'methodOnNonNullInt' cannot be called on 'int?' because it is potentially null.
// ^^^^^^^^^^^^^^^^^^
// [analyzer 6] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE
// [cfe 13] Method 'methodOnNonNullInt' cannot be called on 'int?' because it is potentially null.
}
call_invocation(C c) {
if (c.f == null) return;
c.f.call();
// ^^^^
// [analyzer 7] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE
// [cfe 14] Method 'call' cannot be called on 'void Function()?' because it is potentially null.
// ^^^^
// [analyzer 7] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE
// [cfe 14] Method 'call' cannot be called on 'void Function()?' because it is potentially null.
}
@@ -31,7 +31,7 @@ class C2 {
userDefinableUnaryOp(C2 c) {
if (c.bad == null) return;
-c.bad;
//^
// [analyzer 2] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE
// [cfe 4] Operator 'unary-' cannot be called on 'int?' because it is potentially null.
// [error column 3, length 1]
// [analyzer 2] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE
// [cfe 4] Operator 'unary-' cannot be called on 'int?' because it is potentially null.
}
@@ -22,25 +22,25 @@ class C {
get_property_via_explicit_this() {
if (this.i == null) return;
this.i.isEven;
// ^^^^^^
// [analyzer 1] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE
// [cfe 7] Property 'isEven' cannot be accessed on 'int?' because it is potentially null.
// ^^^^^^
// [analyzer 1] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE
// [cfe 7] Property 'isEven' cannot be accessed on 'int?' because it is potentially null.
}
get_property_via_explicit_this_parenthesized() {
if ((this).i == null) return;
(this).i.isEven;
// ^^^^^^
// [analyzer 2] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE
// [cfe 8] Property 'isEven' cannot be accessed on 'int?' because it is potentially null.
// ^^^^^^
// [analyzer 2] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE
// [cfe 8] Property 'isEven' cannot be accessed on 'int?' because it is potentially null.
}
get_property_by_implicit_this() {
if (i == null) return;
i.isEven;
// ^^^^^^
// [analyzer 3] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE
// [cfe 9] Property 'isEven' cannot be accessed on 'int?' because it is potentially null.
//^^^^^^
// [analyzer 3] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE
// [cfe 9] Property 'isEven' cannot be accessed on 'int?' because it is potentially null.
}
}
@@ -48,26 +48,26 @@ class D extends C {
get_property_via_explicit_super() {
if (super.i == null) return;
super.i.isEven;
// ^^^^^^
// [analyzer 4] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE
// [cfe 10] Property 'isEven' cannot be accessed on 'int?' because it is potentially null.
// ^^^^^^
// [analyzer 4] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE
// [cfe 10] Property 'isEven' cannot be accessed on 'int?' because it is potentially null.
}
get_property_by_implicit_super() {
if (i == null) return;
i.isEven;
// ^^^^^^
// [analyzer 5] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE
// [cfe 11] Property 'isEven' cannot be accessed on 'int?' because it is potentially null.
//^^^^^^
// [analyzer 5] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE
// [cfe 11] Property 'isEven' cannot be accessed on 'int?' because it is potentially null.
}
}
get_property_via_prefixed_identifier(C c) {
if (c.i == null) return;
c.i.isEven;
// ^^^^^^
// [analyzer 6] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE
// [cfe 12] Property 'isEven' cannot be accessed on 'int?' because it is potentially null.
// ^^^^^^
// [analyzer 6] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE
// [cfe 12] Property 'isEven' cannot be accessed on 'int?' because it is potentially null.
}
get_property_via_prefixed_identifier_mismatched_target(C c1, C c2) {
@@ -75,9 +75,9 @@ get_property_via_prefixed_identifier_mismatched_target(C c1, C c2) {
// to promote is on c1, but the property the user is accessing is on c2.
if (c1.i == null) return;
c2.i.isEven;
// ^^^^^^
// [analyzer] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE
// [cfe] Property 'isEven' cannot be accessed on 'int?' because it is potentially null.
// ^^^^^^
// [analyzer] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE
// [cfe] Property 'isEven' cannot be accessed on 'int?' because it is potentially null.
}
get_property_via_prefixed_identifier_mismatched_property(C c) {
@@ -85,7 +85,7 @@ get_property_via_prefixed_identifier_mismatched_property(C c) {
// to promote is C.i, but the property the user is accessing is C.j.
if (c.i == null) return;
c.j.isEven;
// ^^^^^^
// [analyzer] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE
// [cfe] Property 'isEven' cannot be accessed on 'int?' because it is potentially null.
// ^^^^^^
// [analyzer] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE
// [cfe] Property 'isEven' cannot be accessed on 'int?' because it is potentially null.
}
@@ -13,20 +13,20 @@ extension on int? {
extension_explicit_this() {
if (this == null) return;
this.isEven;
// ^^^^^^
// [analyzer 1] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE
// [context 1] 'this' can't be promoted. See http://dart.dev/go/non-promo-this
// [cfe 3] Property 'isEven' cannot be accessed on 'int?' because it is potentially null.
// [context 3] 'this' can't be promoted.
// ^^^^^^
// [analyzer 1] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE
// [context 1] 'this' can't be promoted. See http://dart.dev/go/non-promo-this
// [cfe 3] Property 'isEven' cannot be accessed on 'int?' because it is potentially null.
// [context 3] 'this' can't be promoted.
}
extension_implicit_this() {
if (this == null) return;
isEven;
// ^^^^^^
// [analyzer 2] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE
// [context 2] 'this' can't be promoted. See http://dart.dev/go/non-promo-this
// [cfe 4] Property 'isEven' cannot be accessed on 'int?' because it is potentially null.
// [context 4] 'this' can't be promoted.
// [error column 5, length 6]
// [analyzer 2] COMPILE_TIME_ERROR.UNCHECKED_USE_OF_NULLABLE_VALUE
// [context 2] 'this' can't be promoted. See http://dart.dev/go/non-promo-this
// [cfe 4] Property 'isEven' cannot be accessed on 'int?' because it is potentially null.
// [context 4] 'this' can't be promoted.
}
}
@@ -7,8 +7,8 @@
void main() {
void _() {}
/*indent*/ _();
// ^
_();
// [error column 3, length 1]
// [analyzer] COMPILE_TIME_ERROR.UNDEFINED_FUNCTION
// [cfe] Method not found: '_'.
}
@@ -7,7 +7,7 @@
main() {
int _ = 1;
_ = 2;
//^
// [analyzer] COMPILE_TIME_ERROR.UNDEFINED_IDENTIFIER
// [cfe] Setter not found: '_'.
// [error column 3, length 1]
// [analyzer] COMPILE_TIME_ERROR.UNDEFINED_IDENTIFIER
// [cfe] Setter not found: '_'.
}
@@ -11,23 +11,23 @@ main() {
var value = 'str';
_.topLevel;
//^
// [analyzer] COMPILE_TIME_ERROR.UNDEFINED_IDENTIFIER
// [cfe] Undefined name '_'.
// [error column 3, length 1]
// [analyzer] COMPILE_TIME_ERROR.UNDEFINED_IDENTIFIER
// [cfe] Undefined name '_'.
_.C(value);
//^
// [analyzer] COMPILE_TIME_ERROR.UNDEFINED_IDENTIFIER
// [cfe] Undefined name '_'.
// [error column 3, length 1]
// [analyzer] COMPILE_TIME_ERROR.UNDEFINED_IDENTIFIER
// [cfe] Undefined name '_'.
// Private extensions can't be used.
value.bar;
// ^^^
// [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER
// [cfe] The getter 'bar' isn't defined for the class 'String'.
// ^^^
// [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER
// [cfe] The getter 'bar' isn't defined for the class 'String'.
value.fn;
// ^^
// [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER
// [cfe] The getter 'fn' isn't defined for the class 'String'.
// ^^
// [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER
// [cfe] The getter 'fn' isn't defined for the class 'String'.
}
@@ -8,9 +8,7 @@ class C {
final bool bar;
final bool fn;
C(String str)
: bar = str.bar,
fn = str.fn;
C(String str) : bar = str.bar, fn = str.fn;
}
extension StringExtension on String {
@@ -9,9 +9,9 @@ class C {
var other;
C(this._) : other = _;
// ^
// [analyzer] COMPILE_TIME_ERROR.IMPLICIT_THIS_REFERENCE_IN_INITIALIZER
// [cfe] Can't access 'this' in a field initializer to read '_'.
// ^
// [analyzer] COMPILE_TIME_ERROR.IMPLICIT_THIS_REFERENCE_IN_INITIALIZER
// [cfe] Can't access 'this' in a field initializer to read '_'.
}
class CWithTypeParameter<_> {
@@ -19,7 +19,7 @@ class CWithTypeParameter<_> {
var other;
CWithTypeParameter(this._) : other = _;
// ^
// [analyzer] COMPILE_TIME_ERROR.IMPLICIT_THIS_REFERENCE_IN_INITIALIZER
// [cfe] Can't access 'this' in a field initializer to read '_'.
// ^
// [analyzer] COMPILE_TIME_ERROR.IMPLICIT_THIS_REFERENCE_IN_INITIALIZER
// [cfe] Can't access 'this' in a field initializer to read '_'.
}
@@ -8,12 +8,12 @@ class C {
var _;
C(this._, this._);
// ^
// [analyzer] COMPILE_TIME_ERROR.DUPLICATE_FIELD_FORMAL_PARAMETER
// [cfe] '_' was already initialized by this constructor.
// ^
// [analyzer] COMPILE_TIME_ERROR.DUPLICATE_FIELD_FORMAL_PARAMETER
// [cfe] '_' was already initialized by this constructor.
C.named(this._, this._);
// ^
// [analyzer] COMPILE_TIME_ERROR.DUPLICATE_FIELD_FORMAL_PARAMETER
// [cfe] '_' was already initialized by this constructor.
// ^
// [analyzer] COMPILE_TIME_ERROR.DUPLICATE_FIELD_FORMAL_PARAMETER
// [cfe] '_' was already initialized by this constructor.
}
@@ -8,7 +8,7 @@ import 'package:expect/async_helper.dart';
void main() async {
// Multiple for-loop wildcard declarations.
for (int _ = 0, _ = 2;;) {
for (int _ = 0, _ = 2; ;) {
break;
}
@@ -59,22 +59,23 @@ class StaticMethod {
static int staticMethod2(_, _) => 2;
static int staticMethod_functionType(void _(), void _()) => 2;
static int staticMethod_functionTypeNested(
void _(_, _), void _(int _, int _)) =>
2;
void _(_, _),
void _(int _, int _),
) => 2;
static int staticMethod_functionTypeNew(
void Function(int _, int _) _, void Function(int _, int _) _) =>
2;
void Function(int _, int _) _,
void Function(int _, int _) _,
) => 2;
static int staticMethod_functionTypeGeneric(
void Function<_, _>(int _, int _) _, void _<_>(_, _)) =>
2;
void Function<_, _>(int _, int _) _,
void _<_>(_, _),
) => 2;
}
void main() {
// Function expression
var list = [true];
list.where(
(_, [_]) => true,
);
list.where((_, [_]) => true);
// Abstract methods
var abstractMethod = AbstractMethodSubclass();