Skip to content

Commit 397d6b3

Browse files
authored
#3122. Fix errors in dot shorthands tests. (#3123)
1 parent 055cf3f commit 397d6b3

13 files changed

+15
-27
lines changed

LanguageFeatures/Static-access-shorthand/constant_expression_A10_t13.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ class C {
2121
}
2222

2323
mixin M on C {
24-
static const M answer = const MC(42);
24+
static M answer = const MC(42);
2525
}
2626

2727
class MC extends C with M {

LanguageFeatures/Static-access-shorthand/constant_expression_A10_t15.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ class C {
2121
}
2222

2323
mixin M on C {
24-
static const M answer = const MC(42);
24+
static M answer = const MC(42);
2525
}
2626

2727
class MC extends C with M {

LanguageFeatures/Static-access-shorthand/equality_A01_t02.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ main() {
5757
Expect.isTrue(m2 != .staticMethod<String>("two"));
5858
Expect.equals("MC<int>(2) == MC<String>(two)", m2.log);
5959

60-
MC<String> m3 = MC("one");
60+
M<String> m3 = MC("one");
6161
Expect.isTrue(m3 == .instances[0]);
6262
Expect.equals("MC<String>(one) == MC<String>(one)", m3.log);
6363
Expect.isFalse(m3 != .instances[0]);

LanguageFeatures/Static-access-shorthand/equality_A02_t01.dart

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,5 @@ main() {
6868
// [analyzer] unspecified
6969
// [cfe] unspecified
7070

71-
if (C(0) == foo(.values[0])) {}
72-
// ^
73-
// [analyzer] unspecified
74-
// [cfe] unspecified
71+
if (C(0) == foo(.values[0])) {} // Ok, foo provides the context type
7572
}

LanguageFeatures/Static-access-shorthand/equality_A02_t02.dart

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,5 @@ main() {
7272
// [analyzer] unspecified
7373
// [cfe] unspecified
7474

75-
if (m != foo(.values[0])) {}
76-
// ^
77-
// [analyzer] unspecified
78-
// [cfe] unspecified
75+
if (m != foo(.values[0])) {} // Ok, foo provides the context type
7976
}

LanguageFeatures/Static-access-shorthand/equality_A02_t03.dart

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,5 @@ main() {
5959
// [analyzer] unspecified
6060
// [cfe] unspecified
6161

62-
if (E.e0 == foo(.e0)) {}
63-
// ^
64-
// [analyzer] unspecified
65-
// [cfe] unspecified
62+
if (E.e0 == foo(.e0)) {} // Ok, foo provides the context type
6663
}

LanguageFeatures/Static-access-shorthand/equality_A02_t04.dart

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,5 @@ main() {
6060
// [analyzer] unspecified
6161
// [cfe] unspecified
6262

63-
if (one != foo(.instances[0])) {}
64-
// ^
65-
// [analyzer] unspecified
66-
// [cfe] unspecified
63+
if (one != foo(.instances[0])) {} // Ok, foo provides the context type
6764
}

LanguageFeatures/Static-access-shorthand/equality_A02_t09.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ main() {
6161
// [analyzer] unspecified
6262
// [cfe] unspecified
6363

64-
if ((C() as Object) == .new()) {}
64+
if ((C() as Object) == .id()) {}
6565
// ^
6666
// [analyzer] unspecified
6767
// [cfe] unspecified

LanguageFeatures/Static-access-shorthand/grammar_A01_t05.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ class C {
3737
const C.foo(this.value);
3838

3939
static FutureOr<C> get staticGetter => C("C: static getter");
40-
static FutureOr<C> staticMethod() => C("C; static method");
41-
static FutureOr<List<C>> instances = [C("one"), C("two")];
40+
static FutureOr<C> staticMethod() => C("C: static method");
41+
static List<FutureOr<C>> instances = [C("one"), C("two")];
4242
}
4343

4444
mixin M on C {
@@ -61,7 +61,7 @@ enum E {
6161
extension type ET(int v) {
6262
static FutureOr<ET> get staticGetter => ET(1);
6363
static FutureOr<ET> staticMethod() => ET(2);
64-
static FutureOr<List<ET>> instances = [ET(0), ET(1)];
64+
static List<FutureOr<ET>> instances = [ET(0), ET(1)];
6565
}
6666

6767
main() async {

LanguageFeatures/Static-access-shorthand/non_ambiguity_A02_t02.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,6 @@ main() {
215215
testConstructors();
216216
testVariables();
217217
testGetters();
218-
testMetods();
218+
testMethods();
219219
testEnumValues();
220220
}

LanguageFeatures/Static-access-shorthand/patterns_A01_t03.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ main() {
4747
default:
4848
}
4949

50-
String res = switch (MC(1)) {
50+
res = switch (MC(1)) {
5151
.one => "M one",
5252
// ^
5353
// [analyzer] unspecified

LanguageFeatures/Static-access-shorthand/type_inference_A01_t01.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ main() {
8282
Expect.equals(1, m5.value);
8383

8484
E e1 = .id<String>();
85-
Expect.equals(E.e1, e1);
85+
Expect.equals(E.e0, e1);
8686

8787
E<int> e2 = .id<String>();
8888
Expect.equals(2, e2.value);

LanguageFeatures/Static-access-shorthand/type_inference_A01_t02.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,5 +159,5 @@ main() async {
159159
Expect.equals(3, (await et8)?.v);
160160

161161
FutureOr<FutureOr<ET>> et9 = .id<String>();
162-
Expect.equals(3, (await (await et9)).value);
162+
Expect.equals(3, (await (await et9)).v);
163163
}

0 commit comments

Comments
 (0)