Skip to content

Commit 101fcad

Browse files
johnniwintherCommit Queue
authored andcommitted
[cfe] Update test prior to fix
This updates the bounds check test with more cases in preparation for a follow-up fix. Change-Id: I095832f6453a5a2b1b53fca8a94acf3682fe4403 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/447780 Commit-Queue: Johnni Winther <[email protected]> Reviewed-by: Chloe Stefantsova <[email protected]>
1 parent 9504e96 commit 101fcad

File tree

5 files changed

+893
-392
lines changed

5 files changed

+893
-392
lines changed

pkg/front_end/testcases/extensions/check_bounds.dart

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,14 +36,28 @@ test(A a) {
3636
Extension(classA).method; // Error: Expect bounds mismatch.
3737
Extension(classA).property; // Error: Expect bounds mismatch.
3838
Extension(classA).property = null; // Error: Expect bounds mismatch.
39+
Extension(classA).property += null; // Error: Expect bounds mismatch.
40+
Extension(classA).property ??= 0; // Error: Expect bounds mismatch.
41+
Extension(classA).property(); // Error: Expect bounds mismatch.
42+
Extension(classA).property++; // Error: Expect bounds mismatch.
43+
--Extension(classA).property; // Error: Expect bounds mismatch.
3944
Extension(classA)[0]; // Error: Expect bounds mismatch.
4045
Extension(classA)[0] = null; // Error: Expect bounds mismatch.
46+
Extension(classA)[0] += null; // Error: Expect bounds mismatch.
47+
Extension(classA)[0] ??= 0; // Error: Expect bounds mismatch.
4148
Extension<A>(classA).method(); // Error: Expect bounds mismatch.
4249
Extension<A>(classA).method; // Error: Expect bounds mismatch.
4350
Extension<A>(classA).property; // Error: Expect bounds mismatch.
4451
Extension<A>(classA).property = null; // Error: Expect bounds mismatch.
52+
Extension<A>(classA).property += null; // TODO: Expect bounds mismatch.
53+
Extension<A>(classA).property ??= 0; // Error: Expect bounds mismatch.
54+
Extension<A>(classA).property(); // TODO: Expect bounds mismatch.
55+
Extension<A>(classA).property++; // Error: Expect bounds mismatch.
56+
--Extension<A>(classA).property; // Error: Expect bounds mismatch.
4557
Extension<A>(classA)[0]; // Error: Expect bounds mismatch.
4658
Extension<A>(classA)[0] = null; // Error: Expect bounds mismatch.
59+
Extension<A>(classA)[0] += null; // TODO: Expect bounds mismatch.
60+
Extension<A>(classA)[0] ??= 0; // TODO: Expect bounds mismatch.
4761
Extension(classA).genericMethod(); // Error: Expect bounds mismatch.
4862
Extension(classA).genericMethod(a); // Error: Expect bounds mismatch.
4963
Extension(classA).genericMethod<A>(a); // Error: Expect bounds mismatch.
@@ -62,8 +76,15 @@ test(A a) {
6276
Extension<B>(classB).method;
6377
Extension<B>(classB).property;
6478
Extension<B>(classB).property = null;
79+
Extension<B>(classB).property += null;
80+
Extension<B>(classB).property ??= 0;
81+
Extension<B>(classB).property();
82+
Extension<B>(classB).property++;
83+
--Extension<B>(classB).property;
6584
Extension<B>(classB)[0];
6685
Extension<B>(classB)[0] = null;
86+
Extension<B>(classB)[0] += null;
87+
Extension<B>(classB)[0] ??= 0;
6788
Extension<B>(classB).genericMethod();
6889
Extension<B>(classB).genericMethod(a); // Error: Expect bounds mismatch.
6990
Extension<B>(classB).genericMethod<A>(a); // Error: Argument type mismatch.
@@ -76,8 +97,15 @@ test(A a) {
7697
Extension(classB).method;
7798
Extension(classB).property;
7899
Extension(classB).property = null;
100+
Extension(classB).property += null;
101+
Extension(classB).property ??= 0;
102+
Extension(classB).property();
103+
Extension(classB).property++;
104+
--Extension(classB).property;
79105
Extension(classB)[0];
80106
Extension(classB)[0] = null;
107+
Extension(classB)[0] += null;
108+
Extension(classB)[0] ??= 0;
81109
Extension(classB).genericMethod();
82110
Extension(classB).genericMethod(a); // Error: Expect bounds mismatch.
83111
Extension(classB).genericMethod<A>(a); // Error: Expect bounds mismatch.

0 commit comments

Comments
 (0)