Change language tests to avoid unintended syntax errors
The new feature 'declaring constructors' will change the syntax such
that it is an error for a non-declaring formal parameter declaration
to have the modifier `final`, and it is an error to use `var` as a
replacement for a type annotation (but the type annotation can still
be omitted entirely). This CL removes those modifiers such that the
tests will not start failing on things that aren't errors any more.
Change-Id: Ie6628f66eca696b28900759d8234b814033b4027
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/456740
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Commit-Queue: Erik Ernst <eernst@google.com>
diff --git a/tests/language/async/async_test.dart b/tests/language/async/async_test.dart
index 6cc2c82..7350229 100644
--- a/tests/language/async/async_test.dart
+++ b/tests/language/async/async_test.dart
@@ -131,7 +131,7 @@
asyncEnd();
});
- var checkAsync = (var someFunc) {
+ var checkAsync = (someFunc) {
var toTest = someFunc();
Expect.isTrue(toTest is Future);
asyncStart();
diff --git a/tests/language/class/override_inference_test.dart b/tests/language/class/override_inference_test.dart
index b7594d3..c034c6f 100644
--- a/tests/language/class/override_inference_test.dart
+++ b/tests/language/class/override_inference_test.dart
@@ -87,7 +87,7 @@
// Even if prefixed by `var`, `final`, `required` or `covariant`,
// or if made optional with or without a default value.
class CVar implements IIntInt {
- foo(var x) {
+ foo(x) {
// Checks that x is exactly int.
// It is assignable in both directions, and it's not dynamic.
intVar = x;
@@ -99,7 +99,7 @@
}
class CFinal implements IInt {
- foo(final x) {
+ foo(x) {
var sameTypeAsX = x;
intVar = x;
sameTypeAsX = intVar;
@@ -311,7 +311,7 @@
// Do not inherit `final` with the type.
class IFinal {
- void foo(final int x) {}
+ void foo(int x) {}
}
class CInheritFinal implements IFinal {
diff --git a/tests/language/compile_time_constant/compile_time_constant10_test.dart b/tests/language/compile_time_constant/compile_time_constant10_test.dart
index 94abdcd..101fa49 100644
--- a/tests/language/compile_time_constant/compile_time_constant10_test.dart
+++ b/tests/language/compile_time_constant/compile_time_constant10_test.dart
@@ -38,7 +38,7 @@
final x1;
final x2;
final bool id;
- const CT(var x1, var x2)
+ const CT(x1, x2)
: this.x1 = x1,
this.x2 = x2,
this.id = identical(x1, x2);
diff --git a/tests/language/const/ct_const_test.dart b/tests/language/const/ct_const_test.dart
index f2c7bde..ce27886 100644
--- a/tests/language/const/ct_const_test.dart
+++ b/tests/language/const/ct_const_test.dart
@@ -26,7 +26,7 @@
const Point(x, y) : x_ = x, y_ = y;
const Point.X(x) : x_ = x, y_ = Roman.V - Roman.II - 3;
- bool operator ==(final dynamic other) {
+ bool operator ==(dynamic other) {
return (this.x_ == other.x_) && (this.y_ == other.y_);
}
diff --git a/tests/language/constructor/constructor_test.dart b/tests/language/constructor/constructor_test.dart
index 1be4664..96c0e65 100644
--- a/tests/language/constructor/constructor_test.dart
+++ b/tests/language/constructor/constructor_test.dart
@@ -16,7 +16,7 @@
B(x) : b = x {}
- B.namedB(var x) : b = x {}
+ B.namedB(x) : b = x {}
}
// Test the order of initialization: first the instance variable then
diff --git a/tests/language/constructor/name_test.dart b/tests/language/constructor/name_test.dart
index 8599aec..1aff177 100644
--- a/tests/language/constructor/name_test.dart
+++ b/tests/language/constructor/name_test.dart
@@ -7,8 +7,8 @@
class Foo {
Bar.Foo(); //# 01: compile-time error
- factory Bar(); //# 02: syntax error
- factory Bar.Baz(); //# 03: syntax error
+ factory Bar(); //# 02: compile-time error
+ factory Bar.Baz(); //# 03: compile-time error
}
void main() {
diff --git a/tests/language/covariant/covariant_test.dart b/tests/language/covariant/covariant_test.dart
index b342eea..1bbd31b 100644
--- a/tests/language/covariant/covariant_test.dart
+++ b/tests/language/covariant/covariant_test.dart
@@ -15,7 +15,6 @@
import 'package:expect/expect.dart';
// Top level field may not have a covariant.
-// Would be considered a minor (acceptable) bug, if it was accepted here too.
covariant // //# 00: syntax error
int x0 = 0;
@@ -28,7 +27,6 @@
int get x1 => 499;
// Top level setters may not have a covariant.
-// Would be considered a minor (acceptable) bug, if it was accepted here too.
void set x2(
covariant //# 02: compile-time error
int val) {}
@@ -60,8 +58,7 @@
covariant // //# 07: syntax error
get x7 => 499;
-// Top level setters may not have a covariant.
-// Would be considered a minor (acceptable) bug, if it was accepted here too.
+// Top level setters may not have a covariant parameter.
void set x8(
covariant //# 08: compile-time error
val) {}
@@ -78,7 +75,6 @@
f11() => 499;
// Covariant should not work on top-level methods.
-// It's a minor (acceptable) bug to not error out here.
int f12(
covariant //# 12: compile-time error
int x) =>
@@ -92,32 +88,15 @@
499;
// Covariant should not work on top-level methods.
-// It's a minor (acceptable) bug to not error out here.
int f14(
covariant //# 14: compile-time error
- final x) =>
- 499;
-
-// `Covariant` must be in front of modifiers.
-int f15(
- final
- covariant //# 15: syntax error
x) =>
499;
// Covariant should not work on top-level methods.
-// It's a minor (acceptable) bug to not error out here.
int f16(
covariant //# 16: compile-time error
- final int x) =>
- 499;
-
-// `Covariant` must be in front of modifiers.
-int f17(
- final
- covariant //# 17: syntax error
- int
- x) =>
+ int x) =>
499;
// On its own, `covariant` is just a parameter name.
@@ -128,7 +107,6 @@
// All of the above as statics in a class.
class A {
// Static fields may not have a covariant.
- // Would be considered a minor (acceptable) bug, if it was accepted here too.
static
covariant // //# 20: syntax error
int x20 = 0;
@@ -147,7 +125,6 @@
static int get x21b => 499;
// Static setters may not have a covariant.
- // Would be considered a minor (acceptable) bug, if it was accepted here too.
static void set x22(
covariant //# 22: compile-time error
int val) {}
@@ -181,7 +158,6 @@
static get x27b => 499;
// Static setters may not have a covariant.
- // Would be considered a minor (acceptable) bug, if it was accepted here too.
static void set x28(
covariant //# 28: compile-time error
val) {}
@@ -206,7 +182,6 @@
static f31b() => 499;
// Covariant should not work on static methods.
- // It's a minor (acceptable) bug to not error out here.
static int f32(
covariant //# 32: compile-time error
int x) =>
@@ -220,32 +195,15 @@
499;
// Covariant should not work on top-level methods.
- // It's a minor (acceptable) bug to not error out here.
static int f34(
covariant //# 34: compile-time error
- final x) =>
- 499;
-
- // `Covariant` must be in front of modifiers.
- static int f35(
- final
- covariant //# 35: syntax error
x) =>
499;
// Covariant should not work on top-level methods.
- // It's a minor (acceptable) bug to not error out here.
static int f36(
covariant //# 36: compile-time error
- final int x) =>
- 499;
-
- // `Covariant` must be in front of modifiers.
- static int f37(
- final
- covariant //# 37: syntax error
- int
- x) =>
+ int x) =>
499;
// `Covariant` on its own is just a parameter name.
@@ -324,27 +282,12 @@
int f54(
covariant // //# 54: ok
- final x) =>
- 499;
-
- // `Covariant` must be in front of modifiers.
- int f55(
- final
- covariant //# 55: syntax error
x) =>
499;
int f56(
covariant // //# 56: ok
- final int x) =>
- 499;
-
- // `Covariant` must be in front of modifiers.
- int f57(
- final
- covariant //# 57: syntax error
- int
- x) =>
+ int x) =>
499;
// `Covariant` on its own is just a parameter name.
@@ -374,9 +317,7 @@
use(f12(2));
use(f13(3));
use(f14(3));
- use(f15(3));
use(f16(3));
- use(f17(3));
Expect.equals(123, f18(123));
use(covariant); // //# 19: continued
@@ -401,9 +342,7 @@
use(A.f32(2));
use(A.f33(3));
use(A.f34(3));
- use(A.f35(3));
use(A.f36(3));
- use(A.f37(3));
Expect.equals(1234, A.f38(1234));
use(A.covariant); // //# 39: continued
@@ -426,9 +365,7 @@
use(b.f52(2));
use(b.f53(2));
use(b.f54(3));
- use(b.f55(3));
use(b.f56(3));
- use(b.f57(3));
Expect.equals(12345, b.f58(12345));
use(B.covariant); // //# 59: continued
}
diff --git a/tests/language/final/syntax_test.dart b/tests/language/final/syntax_test.dart
index 86d3544..0dd6f7825 100644
--- a/tests/language/final/syntax_test.dart
+++ b/tests/language/final/syntax_test.dart
@@ -38,9 +38,9 @@
}
final F0 = 42;
-final F1; // //# 03: syntax error
+final F1; // //# 03: compile-time error
final int F2 = 87;
-final int F3; // //# 04: syntax error
+final int F3; // //# 04: compile-time error
class Point {
final x, y;
diff --git a/tests/language/function_subtype/cast2_test.dart b/tests/language/function_subtype/cast2_test.dart
index 5e0f5b7..3f4542a 100644
--- a/tests/language/function_subtype/cast2_test.dart
+++ b/tests/language/function_subtype/cast2_test.dart
@@ -11,7 +11,7 @@
typedef void Bar(int i);
class Class<T> {
- test(bool expectedResult, var o, String typeName) {
+ test(bool expectedResult, o, String typeName) {
if (expectedResult) {
Expect.isNotNull(o as Foo<T>, "bar as Foo<$typeName>");
} else {
diff --git a/tests/language/function_subtype/cast3_test.dart b/tests/language/function_subtype/cast3_test.dart
index ec222ac..9feacb0 100644
--- a/tests/language/function_subtype/cast3_test.dart
+++ b/tests/language/function_subtype/cast3_test.dart
@@ -11,7 +11,7 @@
typedef void Bar(int i);
class Class<T> {
- test(bool expectedResult, var o, String typeName) {
+ test(bool expectedResult, o, String typeName) {
void local() {
if (expectedResult) {
Expect.isNotNull(o as Foo<T>, "bar as Foo<$typeName>");
diff --git a/tests/language/function_subtype/inline2_test.dart b/tests/language/function_subtype/inline2_test.dart
index 734f335..a3cdc31 100644
--- a/tests/language/function_subtype/inline2_test.dart
+++ b/tests/language/function_subtype/inline2_test.dart
@@ -20,7 +20,7 @@
C.c7([int this.field()? = null]);
}
-void test(var f, String constructorName) {
+void test(f, String constructorName) {
testDynamicTypeError(false, () => f(m1), "'new C.$constructorName(m1)'");
testDynamicTypeError(true, () => f(m2), "'new C.$constructorName(m2)'");
testDynamicTypeError(
diff --git a/tests/language/function_subtype/not2_test.dart b/tests/language/function_subtype/not2_test.dart
index e3e76b1..6378f0f 100644
--- a/tests/language/function_subtype/not2_test.dart
+++ b/tests/language/function_subtype/not2_test.dart
@@ -12,7 +12,7 @@
typedef void Bar(int i);
class Class<T> {
- test(bool expectedResult, var o, String typeName) {
+ test(bool expectedResult, o, String typeName) {
Expect.equals(expectedResult, o is! Foo<T>, "bar is! Foo<$typeName>");
Expect.isFalse(o is! Bar, "bar is! Bar");
}
diff --git a/tests/language/function_subtype/not3_test.dart b/tests/language/function_subtype/not3_test.dart
index 268b731..968d8cc 100644
--- a/tests/language/function_subtype/not3_test.dart
+++ b/tests/language/function_subtype/not3_test.dart
@@ -12,7 +12,7 @@
typedef void Bar(int i);
class Class<T> {
- test(bool expectedResult, var o, String typeName) {
+ test(bool expectedResult, o, String typeName) {
void local() {
Expect.equals(expectedResult, o is! Foo<T>, "bar is! Foo<$typeName>");
Expect.isFalse(o is! Bar, "bar is! Bar");
diff --git a/tests/language/identifier/naming_test.dart b/tests/language/identifier/naming_test.dart
index ae442de..dbeb115 100644
--- a/tests/language/identifier/naming_test.dart
+++ b/tests/language/identifier/naming_test.dart
@@ -170,7 +170,7 @@
class Hoisting {
var f_;
- Hoisting.negate(var x) {
+ Hoisting.negate(x) {
f_ = () {
return x;
};
diff --git a/tests/language/instance/incr_deopt_test.dart b/tests/language/instance/incr_deopt_test.dart
index d9424fd..2c840aa 100644
--- a/tests/language/instance/incr_deopt_test.dart
+++ b/tests/language/instance/incr_deopt_test.dart
@@ -31,11 +31,11 @@
Expect.equals(old + 1, a.f);
}
-myIncr(var a) {
+myIncr(a) {
a.f++;
}
-conditionalIncr(var f, var a) {
+conditionalIncr(f, a) {
if (f) {
a.f++;
}
diff --git a/tests/language/language_spec_parser.status b/tests/language/language_spec_parser.status
index a481b6d..f2fe59b 100644
--- a/tests/language/language_spec_parser.status
+++ b/tests/language/language_spec_parser.status
@@ -8,6 +8,7 @@
const/native_factory_test: Skip # Uses `native`.
double/invalid_test: Skip # Contains illegally formatted double.
regress/regress1751477_test: Skip # Times out: 9 levels, exponential blowup => 430 secs.
+switch/issue_60375_test: Skip # Dart 2.19.
switch/switch_legacy_test: Skip # Dart 2.19.
syntax/deep_nesting_expression_test: Skip # JVM stack overflow.
syntax/deep_nesting_statement_test: Skip # JVM stack overflow.
diff --git a/tests/language/metadata/cyclic_test.dart b/tests/language/metadata/cyclic_test.dart
index 8270fd1..cce3797 100644
--- a/tests/language/metadata/cyclic_test.dart
+++ b/tests/language/metadata/cyclic_test.dart
@@ -16,11 +16,11 @@
}
class Sub1 extends Super {
- const Sub1(var field) : super(field);
+ const Sub1(field) : super(field);
}
class Sub2 extends Super {
- const Sub2(var field) : super(field);
+ const Sub2(field) : super(field);
}
void main() {
diff --git a/tests/language/method/binding_test.dart b/tests/language/method/binding_test.dart
index 7755d1c..f536980 100644
--- a/tests/language/method/binding_test.dart
+++ b/tests/language/method/binding_test.dart
@@ -45,7 +45,7 @@
return (baz)();
}
- invokeBar(var obj) {
+ invokeBar(obj) {
return (obj.bar)();
}
diff --git a/tests/language/nnbd/syntax/late_modifier_error_test.dart b/tests/language/nnbd/syntax/late_modifier_error_test.dart
index f4ee509..1768873 100644
--- a/tests/language/nnbd/syntax/late_modifier_error_test.dart
+++ b/tests/language/nnbd/syntax/late_modifier_error_test.dart
@@ -9,7 +9,7 @@
late //# 01: syntax error
int f1(
- late //# 02: compile-time error
+ late //# 02: syntax error
int x
) => throw 0;
diff --git a/tests/language/null/null_test.dart b/tests/language/null/null_test.dart
index 48ff7e3..0cb7e90 100644
--- a/tests/language/null/null_test.dart
+++ b/tests/language/null/null_test.dart
@@ -47,15 +47,15 @@
}
void test() {
- void foo(var obj) {
+ void foo(obj) {
Expect.equals(null, obj);
}
- bool compareToNull(var value) {
+ bool compareToNull(value) {
return null == value;
}
- bool compareWithNull(var value) {
+ bool compareWithNull(value) {
return value == null;
}
diff --git a/tests/language/operator/arithmetic_test.dart b/tests/language/operator/arithmetic_test.dart
index 701deb2..eea5481 100644
--- a/tests/language/operator/arithmetic_test.dart
+++ b/tests/language/operator/arithmetic_test.dart
@@ -531,7 +531,7 @@
}
}
- static mySqrt(var x) => sqrt(x);
+ static mySqrt(x) => sqrt(x);
static testSqrtDeopt() {
for (var i = 0; i < 10; i++) mySqrt(4.0);
diff --git a/tests/language/optimize/osr_test.dart b/tests/language/optimize/osr_test.dart
index 0e6f18a..1779603 100644
--- a/tests/language/optimize/osr_test.dart
+++ b/tests/language/optimize/osr_test.dart
@@ -41,7 +41,7 @@
// From library co19 sort_A01_t02.
sort_A01_t02_test(List create([int length])) {
- int c(var a, var b) {
+ int c(a, b) {
return a < b ? -1 : (a == b ? 0 : 1);
}
diff --git a/tests/language/optimize/setter_test.dart b/tests/language/optimize/setter_test.dart
index 60cf407..28658a9 100644
--- a/tests/language/optimize/setter_test.dart
+++ b/tests/language/optimize/setter_test.dart
@@ -13,7 +13,7 @@
class B extends A {}
void sameImplicitSetter() {
- oneTarget(var a, var v) {
+ oneTarget(a, v) {
a.field = v;
}
@@ -38,7 +38,7 @@
// Deoptimize when no feedback exists.
void setterNoFeedback() {
- maybeSet(var a, var v, bool set_it) {
+ maybeSet(a, v, bool set_it) {
if (set_it) {
return a.field = v;
}
@@ -72,11 +72,11 @@
}
void sameNotImplicitSetter() {
- oneTarget(var a, var v) {
+ oneTarget(a, v) {
return a.field = v;
}
- incField(var a) {
+ incField(a) {
a.field++;
}
@@ -98,7 +98,7 @@
}
multiImplicitSetter() {
- oneTarget(var a, var v) {
+ oneTarget(a, v) {
return a.field = v;
}
@@ -125,7 +125,7 @@
}
multiNotImplicitSetter() {
- oneTarget(var a, var v) {
+ oneTarget(a, v) {
return a.field = v;
}
diff --git a/tests/language/optimize/string_charcodeat_test.dart b/tests/language/optimize/string_charcodeat_test.dart
index 14e09db..2433ab1 100644
--- a/tests/language/optimize/string_charcodeat_test.dart
+++ b/tests/language/optimize/string_charcodeat_test.dart
@@ -46,7 +46,7 @@
return test();
}
-int testOneByteCodeUnitAtInLoop(var x) {
+int testOneByteCodeUnitAtInLoop(x) {
var result = 0;
for (int i = 0; i < x.length; i++) {
result += x.codeUnitAt(i) as int;
@@ -54,7 +54,7 @@
return result;
}
-int testTwoByteCodeUnitAtInLoop(var x) {
+int testTwoByteCodeUnitAtInLoop(x) {
var result = 0;
for (int i = 0; i < x.length; i++) {
result += x.codeUnitAt(i) as int;
diff --git a/tests/language/redirecting/factory_long_test.dart b/tests/language/redirecting/factory_long_test.dart
index 5066dc7..6491298 100644
--- a/tests/language/redirecting/factory_long_test.dart
+++ b/tests/language/redirecting/factory_long_test.dart
@@ -55,7 +55,7 @@
testZ(const X2());
}
-void testC(var c) {
+void testC(c) {
Expect.isTrue(c is C);
Expect.isTrue(c is D<int>);
Expect.isTrue(c is! D<String>);
@@ -65,7 +65,7 @@
Expect.equals(42, c.field);
}
-void testZ(var z) {
+void testZ(z) {
Expect.isTrue(z is X<int>);
Expect.isTrue(z is! X<String>);
Expect.isTrue(z is X1<int>);
diff --git a/tests/language/regress/regress18435_test.dart b/tests/language/regress/regress18435_test.dart
index 267562f..2711168 100644
--- a/tests/language/regress/regress18435_test.dart
+++ b/tests/language/regress/regress18435_test.dart
@@ -9,12 +9,12 @@
main() {
const MISSING_VALUE = "MISSING_VALUE";
- void foo([var p1 = MISSING_VALUE, var p2 = MISSING_VALUE]) {
+ void foo([p1 = MISSING_VALUE, p2 = MISSING_VALUE]) {
Expect.equals("P1", p1);
Expect.equals("P2", p2);
}
- void bar([var p1 = "MISSING_VALUE", var p2 = "MISSING_VALUE"]) {
+ void bar([p1 = "MISSING_VALUE", p2 = "MISSING_VALUE"]) {
Expect.equals("P1", p1);
Expect.equals("P2", p2);
}
diff --git a/tests/language/regress/regress4157508_test.dart b/tests/language/regress/regress4157508_test.dart
index af08c9d..d537f26 100644
--- a/tests/language/regress/regress4157508_test.dart
+++ b/tests/language/regress/regress4157508_test.dart
@@ -3,7 +3,7 @@
// BSD-style license that can be found in the LICENSE file.
class Issue4157508Test {
- Issue4157508Test(var v) {
+ Issue4157508Test(v) {
var d = new DateTime.fromMillisecondsSinceEpoch(v, isUtc: true);
}
diff --git a/tests/language/setter/no_getter_call_runtime_test.dart b/tests/language/setter/no_getter_call_runtime_test.dart
index 121c1ae..c050186 100644
--- a/tests/language/setter/no_getter_call_runtime_test.dart
+++ b/tests/language/setter/no_getter_call_runtime_test.dart
@@ -11,7 +11,7 @@
get topLevel => topLevelClosure;
-set topLevel(var value) {}
+set topLevel(value) {}
initialize() {
print("initializing");
diff --git a/tests/language/string/supertype_checked_test.dart b/tests/language/string/supertype_checked_test.dart
index 016c757..e24d247 100644
--- a/tests/language/string/supertype_checked_test.dart
+++ b/tests/language/string/supertype_checked_test.dart
@@ -17,7 +17,7 @@
return value.compareTo(o.value);
}
- A promote(var other) {
+ A promote(other) {
return other;
}
}
diff --git a/tests/language/super/bound_closure_test.dart b/tests/language/super/bound_closure_test.dart
index dcbc624..95d058a 100644
--- a/tests/language/super/bound_closure_test.dart
+++ b/tests/language/super/bound_closure_test.dart
@@ -8,27 +8,27 @@
import "package:expect/expect.dart";
class A {
- bar([var optional = 1]) => 498 + optional;
+ bar([optional = 1]) => 498 + optional;
bar2({namedOptional = 2}) => 40 + namedOptional;
- bar3(x, [var optional = 3]) => x + 498 + optional;
+ bar3(x, [optional = 3]) => x + 498 + optional;
bar4(x, {namedOptional = 4}) => 422 + x + namedOptional;
// Gee is the same as bar, but we make sure that gee is used. Potentially
// this yields different code if the redirecting stub exists.
- gee([var optional = 1]) => 498 + optional;
+ gee([optional = 1]) => 498 + optional;
gee2({namedOptional = 2}) => 40 + namedOptional;
- gee3(x, [var optional = 3]) => x + 498 + optional;
+ gee3(x, [optional = 3]) => x + 498 + optional;
gee4(x, {namedOptional = 4}) => 422 + x + namedOptional;
// Use identifiers that could be intercepted.
- add([var optional = 33]) => 1234 + optional;
+ add([optional = 33]) => 1234 + optional;
trim({namedOptional = 22}) => 1313 + namedOptional;
sublist(x, [optional = 44]) => 4321 + optional + x;
splitMapJoin(x, {onMatch = 55, onNonMatch = 66}) =>
111 + x + onMatch + onNonMatch;
// Other interceptable identifiers, but all of them are used.
- shuffle([var optional = 121]) => 12342 + optional;
+ shuffle([optional = 121]) => 12342 + optional;
toList({growable = 2233}) => 13131 + growable;
lastIndexOf(x, [optional = 424]) => 14321 + optional + x;
lastWhere(x, {orElse = 555}) => x + 1213 + 555;
@@ -75,22 +75,22 @@
fooIntercept27() => confuse(super.lastWhere)(0);
fooIntercept28() => confuse(super.lastWhere)(3, orElse: 77);
- bar([var optional]) => -1; // //# 01: ok
+ bar([optional]) => -1; // //# 01: ok
bar2({namedOptional}) => -1; // //# 01: continued
- bar3(x, [var optional]) => -1; // //# 01: continued
+ bar3(x, [optional]) => -1; // //# 01: continued
bar4(x, {namedOptional}) => -1; //# 01: continued
- gee([var optional]) => -1; // //# 01: continued
+ gee([optional]) => -1; // //# 01: continued
gee2({namedOptional}) => -1; // //# 01: continued
- gee3(x, [var optional]) => -1; // //# 01: continued
+ gee3(x, [optional]) => -1; // //# 01: continued
gee4(x, {namedOptional}) => -1; //# 01: continued
- add([var optional = 33]) => -1;
+ add([optional = 33]) => -1;
trim({namedOptional = 22}) => -1;
sublist(x, [optional = 44]) => -1;
splitMapJoin(x, {onMatch = 55, onNonMatch = 66}) => -1;
- shuffle([var optional = 121]) => -1;
+ shuffle([optional = 121]) => -1;
toList({growable = 2233}) => -1;
lastIndexOf(x, [optional = 424]) => -1;
lastWhere(x, {orElse = 555}) => -1;
diff --git a/tests/language/switch/case_static_const_test.dart b/tests/language/switch/case_static_const_test.dart
index e15a9f4..8660125 100644
--- a/tests/language/switch/case_static_const_test.dart
+++ b/tests/language/switch/case_static_const_test.dart
@@ -8,7 +8,7 @@
const S = 'S';
-foo(var p) {
+foo(p) {
switch (p) {
case S:
break;
diff --git a/tests/language/sync_star/generator2_test.dart b/tests/language/sync_star/generator2_test.dart
index f83261c..bec0c10 100644
--- a/tests/language/sync_star/generator2_test.dart
+++ b/tests/language/sync_star/generator2_test.dart
@@ -44,7 +44,7 @@
K() sync* {} // //# 50: compile-time error
get nix sync* {}
get garnix sync* => null; // //# 51: syntax error
- set etwas(var z) sync* { } // //# 52: compile-time error
+ set etwas(z) sync* { } // //# 52: compile-time error
sync() sync* {
yield sync; // Yields a tear-off of the sync() method.
}
diff --git a/tests/language/syntax/syntax_test.dart b/tests/language/syntax/syntax_test.dart
index 6339a36..cdee7fd 100644
--- a/tests/language/syntax/syntax_test.dart
+++ b/tests/language/syntax/syntax_test.dart
@@ -93,7 +93,7 @@
abstract class Fisk {}
-abstract class I implements UNKNOWN; //# 34: syntax error
+abstract class I implements UNKNOWN; //# 34: compile-time error
class XWindow extends DOMWindow
hest "*Window" //# 35: syntax error
@@ -155,7 +155,7 @@
abstract class G<T> {}
-typedef <T>(); //# 48: syntax error
+typedef <T>(); //# 48: compile-time error
class B
extends void //# 49: syntax error
diff --git a/tests/language/this/in_initializer_test.dart b/tests/language/this/in_initializer_test.dart
index 1a7c5c9..a7f4cdb 100644
--- a/tests/language/this/in_initializer_test.dart
+++ b/tests/language/this/in_initializer_test.dart
@@ -11,9 +11,9 @@
var x;
foo() => null;
- bar(var y) => y;
+ bar(y) => y;
static sfoo() => null;
- static sbar(var y) => y;
+ static sbar(y) => y;
A.next();
diff --git a/tests/language/top_level/collision1_test.dart b/tests/language/top_level/collision1_test.dart
index 8423636..df07cfc 100644
--- a/tests/language/top_level/collision1_test.dart
+++ b/tests/language/top_level/collision1_test.dart
@@ -7,8 +7,8 @@
int x = 100;
-get x => 200; // //# 00: compile-time error
-set x(var i) { print(i); } // //# 01: compile-time error
+get x => 200; // //# 00: compile-time error
+set x(i) { print(i); } // //# 01: compile-time error
int x(a, b) { print(a + b); } // //# 02: compile-time error
diff --git a/tests/language/top_level/collision2_test.dart b/tests/language/top_level/collision2_test.dart
index b389446..21f1b01 100644
--- a/tests/language/top_level/collision2_test.dart
+++ b/tests/language/top_level/collision2_test.dart
@@ -8,7 +8,7 @@
get x => 200;
// Ok: can have a setter named x when getter x is defined.
-set x(var i) {
+set x(i) {
print(i);
}
diff --git a/tests/language/unsorted/check_method_override_runtime_test.dart b/tests/language/unsorted/check_method_override_runtime_test.dart
index 63f6316..449093b 100644
--- a/tests/language/unsorted/check_method_override_runtime_test.dart
+++ b/tests/language/unsorted/check_method_override_runtime_test.dart
@@ -6,8 +6,8 @@
// BSD-style license that can be found in the LICENSE file.
class A {
- f([var x]) {}
- foo(var a, [x, y]) {}
+ f([x]) {}
+ foo(a, [x, y]) {}
}
class C extends A {}
diff --git a/tests/language/unsorted/mega_load_test.dart b/tests/language/unsorted/mega_load_test.dart
index 29790a6..d7920f6 100644
--- a/tests/language/unsorted/mega_load_test.dart
+++ b/tests/language/unsorted/mega_load_test.dart
@@ -193,7 +193,7 @@
return list;
}
-callThemAll(var list) {
+callThemAll(list) {
for (var i = 0; i < list.length; i++) {
Expect.equals(i, list[i].f);
}
diff --git a/tests/language/variable/fixed_type_variable2_test.dart b/tests/language/variable/fixed_type_variable2_test.dart
index 481dc56..327e63a 100644
--- a/tests/language/variable/fixed_type_variable2_test.dart
+++ b/tests/language/variable/fixed_type_variable2_test.dart
@@ -19,7 +19,7 @@
class B<T> {
T? value;
- void test(var o, bool expect) {
+ void test(o, bool expect) {
Expect.equals(expect, o is T);
}
}
diff --git a/tests/language/variable/fixed_type_variable_test.dart b/tests/language/variable/fixed_type_variable_test.dart
index 0065f93..d23cc11 100644
--- a/tests/language/variable/fixed_type_variable_test.dart
+++ b/tests/language/variable/fixed_type_variable_test.dart
@@ -19,7 +19,7 @@
class B<T> {
T? value;
- void test(var type, bool expect) {
+ void test(type, bool expect) {
Expect.equals(expect, T == type);
}
}
diff --git a/tests/language/variable/inst_field_initializer_test.dart b/tests/language/variable/inst_field_initializer_test.dart
index c04fe11..93c47c1 100644
--- a/tests/language/variable/inst_field_initializer_test.dart
+++ b/tests/language/variable/inst_field_initializer_test.dart
@@ -29,7 +29,7 @@
// Test that static const field Cheese.mild is not shadowed
// by the parameter mild when compiling the field initializer
// for instance field smell.
- Cheese.hideAndSeek(var mild) : name = mild {
+ Cheese.hideAndSeek(mild) : name = mild {
Expect.equals(mild, this.name);
Expect.equals(Cheese.mild, this.smell);
}
diff --git a/tests/language/vm/regress_16873_test.dart b/tests/language/vm/regress_16873_test.dart
index 12bc1ef..19e0a21 100644
--- a/tests/language/vm/regress_16873_test.dart
+++ b/tests/language/vm/regress_16873_test.dart
@@ -9,7 +9,7 @@
import 'dart:collection';
-void testCollection(var collection, n) {
+void testCollection(collection, n) {
for (int i = 0; i < n; i++) {
if (i % 1000 == 0) print(i);
collection.add(i);