#1231. Super parameters tests fixed and new ones added
diff --git a/LanguageFeatures/Super-parameters/semantics_A02_t01.dart b/LanguageFeatures/Super-parameters/semantics_A02_t01.dart
index 94e781b..6e908bb 100644
--- a/LanguageFeatures/Super-parameters/semantics_A02_t01.dart
+++ b/LanguageFeatures/Super-parameters/semantics_A02_t01.dart
@@ -15,11 +15,12 @@
class S {
int s1 = 0;
+ S(this.s1);
}
class C extends S {
int i;
- C(this i, var super.s1) {
+ C(this.i, var super.s1) {
// ^^^
// [analyzer] unspecified
// [cfe] unspecified
diff --git a/LanguageFeatures/Super-parameters/semantics_A02_t02.dart b/LanguageFeatures/Super-parameters/semantics_A02_t02.dart
index 560f3fb..ba73b37 100644
--- a/LanguageFeatures/Super-parameters/semantics_A02_t02.dart
+++ b/LanguageFeatures/Super-parameters/semantics_A02_t02.dart
@@ -7,20 +7,21 @@
/// const or late occurs in a parameter declaration, this also applies to
/// super-parameters).
///
-/// @description Check that it is a compile-time error if const occurs as the
+/// @description Check that it is a compile-time error if var occurs as the
/// first token of a <superFormalParameter> production
/// @author sgrekhov@unipro.ru
// SharedOptions=--enable-experiment=super-parameters
class S {
- int s1 = 0;
+ int s1;
+ S([this.s1 = 0]);
}
class C extends S {
int i;
- C(this i, const super.s1) {
-// ^^^^^
+ C(this.i, [var super.s1]) {
+// ^^^
// [analyzer] unspecified
// [cfe] unspecified
this.i = i;
diff --git a/LanguageFeatures/Super-parameters/semantics_A02_t03.dart b/LanguageFeatures/Super-parameters/semantics_A02_t03.dart
index 5012885..61c7d6e 100644
--- a/LanguageFeatures/Super-parameters/semantics_A02_t03.dart
+++ b/LanguageFeatures/Super-parameters/semantics_A02_t03.dart
@@ -7,25 +7,26 @@
/// const or late occurs in a parameter declaration, this also applies to
/// super-parameters).
///
-/// @description Check that it is a compile-time error if late occurs as the
+/// @description Check that it is a compile-time error if var occurs as the
/// first token of a <superFormalParameter> production
/// @author sgrekhov@unipro.ru
// SharedOptions=--enable-experiment=super-parameters
class S {
- int s1 = 0;
+ int s1;
+ S({this.s1 = 0});
}
class C extends S {
int i;
- C(this i, late super.s1) {
-// ^^^^
+ C(this.i, {var super.s1}) {
+// ^^^
// [analyzer] unspecified
// [cfe] unspecified
this.i = i;
}
}
main() {
- C(42, 0);
+ C(42, s1: 0);
}
diff --git a/LanguageFeatures/Super-parameters/semantics_A02_t04.dart b/LanguageFeatures/Super-parameters/semantics_A02_t04.dart
new file mode 100644
index 0000000..68dfd3f
--- /dev/null
+++ b/LanguageFeatures/Super-parameters/semantics_A02_t04.dart
@@ -0,0 +1,32 @@
+// Copyright (c) 2021, the Dart project authors. Please see the AUTHORS file
+// 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.
+
+/// @assertion It’s a compile-time error if var occurs as the first token of a
+/// <superFormalParameter> production. (It’s generally a compile-time error if
+/// const or late occurs in a parameter declaration, this also applies to
+/// super-parameters).
+///
+/// @description Check that it is a compile-time error if late occurs as the
+/// first token of a <superFormalParameter> production
+/// @author sgrekhov@unipro.ru
+
+// SharedOptions=--enable-experiment=super-parameters
+
+class S {
+ int s1 = 0;
+ S(this.s1);
+}
+
+class C extends S {
+ int i;
+ C(this.i, late super.s1) {
+// ^^^^
+// [analyzer] unspecified
+// [cfe] unspecified
+ this.i = i;
+ }
+}
+main() {
+ C(42, 0);
+}
diff --git a/LanguageFeatures/Super-parameters/semantics_A02_t05.dart b/LanguageFeatures/Super-parameters/semantics_A02_t05.dart
new file mode 100644
index 0000000..f0877bc
--- /dev/null
+++ b/LanguageFeatures/Super-parameters/semantics_A02_t05.dart
@@ -0,0 +1,32 @@
+// Copyright (c) 2021, the Dart project authors. Please see the AUTHORS file
+// 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.
+
+/// @assertion It’s a compile-time error if var occurs as the first token of a
+/// <superFormalParameter> production. (It’s generally a compile-time error if
+/// const or late occurs in a parameter declaration, this also applies to
+/// super-parameters).
+///
+/// @description Check that it is a compile-time error if late occurs as the
+/// first token of a <superFormalParameter> production
+/// @author sgrekhov@unipro.ru
+
+// SharedOptions=--enable-experiment=super-parameters
+
+class S {
+ int s1;
+ S([this.s1 = 0]);
+}
+
+class C extends S {
+ int i;
+ C(this.i, [late super.s1]) {
+// ^^^^
+// [analyzer] unspecified
+// [cfe] unspecified
+ this.i = i;
+ }
+}
+main() {
+ C(42, 0);
+}
diff --git a/LanguageFeatures/Super-parameters/semantics_A02_t06.dart b/LanguageFeatures/Super-parameters/semantics_A02_t06.dart
new file mode 100644
index 0000000..b937ab9
--- /dev/null
+++ b/LanguageFeatures/Super-parameters/semantics_A02_t06.dart
@@ -0,0 +1,32 @@
+// Copyright (c) 2021, the Dart project authors. Please see the AUTHORS file
+// 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.
+
+/// @assertion It’s a compile-time error if var occurs as the first token of a
+/// <superFormalParameter> production. (It’s generally a compile-time error if
+/// const or late occurs in a parameter declaration, this also applies to
+/// super-parameters).
+///
+/// @description Check that it is a compile-time error if late occurs as the
+/// first token of a <superFormalParameter> production
+/// @author sgrekhov@unipro.ru
+
+// SharedOptions=--enable-experiment=super-parameters
+
+class S {
+ int s1;
+ S({this.s1 = 0});
+}
+
+class C extends S {
+ int i;
+ C(this.i, {late super.s1}) {
+// ^^^^
+// [analyzer] unspecified
+// [cfe] unspecified
+ this.i = i;
+ }
+}
+main() {
+ C(42, s1: 0);
+}
diff --git a/LanguageFeatures/Super-parameters/semantics_A02_t07.dart b/LanguageFeatures/Super-parameters/semantics_A02_t07.dart
new file mode 100644
index 0000000..a8feafe
--- /dev/null
+++ b/LanguageFeatures/Super-parameters/semantics_A02_t07.dart
@@ -0,0 +1,32 @@
+// Copyright (c) 2021, the Dart project authors. Please see the AUTHORS file
+// 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.
+
+/// @assertion It’s a compile-time error if var occurs as the first token of a
+/// <superFormalParameter> production. (It’s generally a compile-time error if
+/// const or late occurs in a parameter declaration, this also applies to
+/// super-parameters).
+///
+/// @description Check that it is a compile-time error if const occurs as the
+/// first token of a <superFormalParameter> production
+/// @author sgrekhov@unipro.ru
+
+// SharedOptions=--enable-experiment=super-parameters
+
+class S {
+ int s1 = 0;
+ S(this.s1);
+}
+
+class C extends S {
+ int i;
+ C(this.i, const super.s1) {
+// ^^^^^
+// [analyzer] unspecified
+// [cfe] unspecified
+ this.i = i;
+ }
+}
+main() {
+ C(42, 0);
+}
diff --git a/LanguageFeatures/Super-parameters/semantics_A02_t08.dart b/LanguageFeatures/Super-parameters/semantics_A02_t08.dart
new file mode 100644
index 0000000..c813d0c
--- /dev/null
+++ b/LanguageFeatures/Super-parameters/semantics_A02_t08.dart
@@ -0,0 +1,32 @@
+// Copyright (c) 2021, the Dart project authors. Please see the AUTHORS file
+// 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.
+
+/// @assertion It’s a compile-time error if var occurs as the first token of a
+/// <superFormalParameter> production. (It’s generally a compile-time error if
+/// const or late occurs in a parameter declaration, this also applies to
+/// super-parameters).
+///
+/// @description Check that it is a compile-time error if const occurs as the
+/// first token of a <superFormalParameter> production
+/// @author sgrekhov@unipro.ru
+
+// SharedOptions=--enable-experiment=super-parameters
+
+class S {
+ int s1;
+ S([this.s1 = 0]);
+}
+
+class C extends S {
+ int i;
+ C(this.i, [const super.s1]) {
+// ^^^^^
+// [analyzer] unspecified
+// [cfe] unspecified
+ this.i = i;
+ }
+}
+main() {
+ C(42, 0);
+}
diff --git a/LanguageFeatures/Super-parameters/semantics_A02_t09.dart b/LanguageFeatures/Super-parameters/semantics_A02_t09.dart
new file mode 100644
index 0000000..b765eec
--- /dev/null
+++ b/LanguageFeatures/Super-parameters/semantics_A02_t09.dart
@@ -0,0 +1,32 @@
+// Copyright (c) 2021, the Dart project authors. Please see the AUTHORS file
+// 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.
+
+/// @assertion It’s a compile-time error if var occurs as the first token of a
+/// <superFormalParameter> production. (It’s generally a compile-time error if
+/// const or late occurs in a parameter declaration, this also applies to
+/// super-parameters).
+///
+/// @description Check that it is a compile-time error if const occurs as the
+/// first token of a <superFormalParameter> production
+/// @author sgrekhov@unipro.ru
+
+// SharedOptions=--enable-experiment=super-parameters
+
+class S {
+ int s1;
+ S({this.s1 = 0});
+}
+
+class C extends S {
+ int i;
+ C(this.i, {const super.s1}) {
+// ^^^^^
+// [analyzer] unspecified
+// [cfe] unspecified
+ this.i = i;
+ }
+}
+main() {
+ C(42, s1: 0);
+}
diff --git a/LanguageFeatures/Super-parameters/semantics_A03_t03.dart b/LanguageFeatures/Super-parameters/semantics_A03_t03.dart
index 2568a12..4fdb7d8 100644
--- a/LanguageFeatures/Super-parameters/semantics_A03_t03.dart
+++ b/LanguageFeatures/Super-parameters/semantics_A03_t03.dart
@@ -18,7 +18,7 @@
class S {
int s1;
int s2 = 0;
- S({required int s1}) : this.s1 = s1;
+ S(this.s2, {required int s1}) : this.s1 = s1;
}
class C extends S {
diff --git a/LanguageFeatures/Super-parameters/semantics_A03_t05.dart b/LanguageFeatures/Super-parameters/semantics_A03_t05.dart
new file mode 100644
index 0000000..51f3c03
--- /dev/null
+++ b/LanguageFeatures/Super-parameters/semantics_A03_t05.dart
@@ -0,0 +1,32 @@
+// Copyright (c) 2021, the Dart project authors. Please see the AUTHORS file
+// 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.
+
+/// @assertion It’s also a compile-time error if a constructor has a positional
+/// super-parameter and the super-constructor invocation at the end of its
+/// initializer list has a positional argument.
+///
+/// @description Check that it is a compile-time error if a constructor has a
+/// positional super-parameter and the super-constructor invocation at the end
+/// of its initializer list has a positional argument
+/// @author sgrekhov@unipro.ru
+
+// SharedOptions=--enable-experiment=super-parameters
+
+class S {
+ int s1;
+ int s2;
+ S(this.s1, this.s2);
+}
+
+class C extends S {
+ int i1;
+ int i2;
+ C(this.i1, int i, super.s1) : this.i2 = i, super(i);
+// ^
+// [analyzer] unspecified
+// [cfe] unspecified
+}
+main() {
+ C(1, 2, 3);
+}
diff --git a/LanguageFeatures/Super-parameters/semantics_A04_t04.dart b/LanguageFeatures/Super-parameters/semantics_A04_t04.dart
new file mode 100644
index 0000000..e3f470e
--- /dev/null
+++ b/LanguageFeatures/Super-parameters/semantics_A04_t04.dart
@@ -0,0 +1,27 @@
+// Copyright (c) 2021, the Dart project authors. Please see the AUTHORS file
+// 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.
+
+/// @assertion It’s a compile-time error if a constructor (or any function) has
+/// two parameter declarations with the same name.
+///
+/// @description Check that it is a compile-time error if a constructor has
+/// two parameter declarations with the same name.
+/// @author sgrekhov@unipro.ru
+
+// SharedOptions=--enable-experiment=super-parameters
+class S {
+ int s1;
+ S(this.s1);
+}
+
+class C extends S {
+ int i1;
+ C(this.i1, super.s1, super.s1);
+// ^^^^^^^^
+// [analyzer] unspecified
+// [cfe] unspecified
+}
+main() {
+ C(1, 2, 3);
+}
diff --git a/LanguageFeatures/Super-parameters/semantics_A04_t05.dart b/LanguageFeatures/Super-parameters/semantics_A04_t05.dart
new file mode 100644
index 0000000..8b185b0
--- /dev/null
+++ b/LanguageFeatures/Super-parameters/semantics_A04_t05.dart
@@ -0,0 +1,27 @@
+// Copyright (c) 2021, the Dart project authors. Please see the AUTHORS file
+// 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.
+
+/// @assertion It’s a compile-time error if a constructor (or any function) has
+/// two parameter declarations with the same name.
+///
+/// @description Check that it is a compile-time error if a constructor has
+/// two parameter declarations with the same name.
+/// @author sgrekhov@unipro.ru
+
+// SharedOptions=--enable-experiment=super-parameters
+class S {
+ int s1;
+ S(this.s1);
+}
+
+class C extends S {
+ int i1;
+ C(this.i1, super.s1, [super.s1 = 0]);
+// ^^^^^^^^
+// [analyzer] unspecified
+// [cfe] unspecified
+}
+main() {
+ C(1, 2);
+}
diff --git a/LanguageFeatures/Super-parameters/semantics_A04_t06.dart b/LanguageFeatures/Super-parameters/semantics_A04_t06.dart
new file mode 100644
index 0000000..84563c8
--- /dev/null
+++ b/LanguageFeatures/Super-parameters/semantics_A04_t06.dart
@@ -0,0 +1,27 @@
+// Copyright (c) 2021, the Dart project authors. Please see the AUTHORS file
+// 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.
+
+/// @assertion It’s a compile-time error if a constructor (or any function) has
+/// two parameter declarations with the same name.
+///
+/// @description Check that it is a compile-time error if a constructor has
+/// two parameter declarations with the same name.
+/// @author sgrekhov@unipro.ru
+
+// SharedOptions=--enable-experiment=super-parameters
+class S {
+ int s1;
+ S(this.s1);
+}
+
+class C extends S {
+ int i1;
+ C(this.i1, super.s1, {super.s1 = 0});
+// ^^^^^^^^
+// [analyzer] unspecified
+// [cfe] unspecified
+}
+main() {
+ C(1, 2);
+}
diff --git a/LanguageFeatures/Super-parameters/semantics_A04_t07.dart b/LanguageFeatures/Super-parameters/semantics_A04_t07.dart
new file mode 100644
index 0000000..198fa58
--- /dev/null
+++ b/LanguageFeatures/Super-parameters/semantics_A04_t07.dart
@@ -0,0 +1,27 @@
+// Copyright (c) 2021, the Dart project authors. Please see the AUTHORS file
+// 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.
+
+/// @assertion It’s a compile-time error if a constructor (or any function) has
+/// two parameter declarations with the same name.
+///
+/// @description Check that it is a compile-time error if a constructor has
+/// two parameter declarations with the same name.
+/// @author sgrekhov@unipro.ru
+
+// SharedOptions=--enable-experiment=super-parameters
+class S {
+ int s1, s2;
+ S(this.s1, [this.s2 = 0]);
+}
+
+class C extends S {
+ int i1;
+ C(this.i1, super.s1, super.s2, super.s2);
+// ^^^^^^^^
+// [analyzer] unspecified
+// [cfe] unspecified
+}
+main() {
+ C(1, 2, 3, 4);
+}
diff --git a/LanguageFeatures/Super-parameters/semantics_A04_t08.dart b/LanguageFeatures/Super-parameters/semantics_A04_t08.dart
new file mode 100644
index 0000000..c83a810
--- /dev/null
+++ b/LanguageFeatures/Super-parameters/semantics_A04_t08.dart
@@ -0,0 +1,27 @@
+// Copyright (c) 2021, the Dart project authors. Please see the AUTHORS file
+// 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.
+
+/// @assertion It’s a compile-time error if a constructor (or any function) has
+/// two parameter declarations with the same name.
+///
+/// @description Check that it is a compile-time error if a constructor has
+/// two parameter declarations with the same name.
+/// @author sgrekhov@unipro.ru
+
+// SharedOptions=--enable-experiment=super-parameters
+class S {
+ int s1, s2;
+ S(this.s1, [this.s2 = 0]);
+}
+
+class C extends S {
+ int i1;
+ C(this.i1, super.s1, super.s2, [super.s2 = 1]);
+// ^^^^^^^^
+// [analyzer] unspecified
+// [cfe] unspecified
+}
+main() {
+ C(1, 2, 3);
+}
diff --git a/LanguageFeatures/Super-parameters/semantics_A04_t09.dart b/LanguageFeatures/Super-parameters/semantics_A04_t09.dart
new file mode 100644
index 0000000..8f26ae2
--- /dev/null
+++ b/LanguageFeatures/Super-parameters/semantics_A04_t09.dart
@@ -0,0 +1,27 @@
+// Copyright (c) 2021, the Dart project authors. Please see the AUTHORS file
+// 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.
+
+/// @assertion It’s a compile-time error if a constructor (or any function) has
+/// two parameter declarations with the same name.
+///
+/// @description Check that it is a compile-time error if a constructor has
+/// two parameter declarations with the same name.
+/// @author sgrekhov@unipro.ru
+
+// SharedOptions=--enable-experiment=super-parameters
+class S {
+ int s1, s2;
+ S(this.s1, [this.s2 = 0]);
+}
+
+class C extends S {
+ int i1;
+ C(this.i1, super.s1, [super.s2, super.s2 = 1]);
+// ^^^^^^^^
+// [analyzer] unspecified
+// [cfe] unspecified
+}
+main() {
+ C(1, 2, 3);
+}
diff --git a/LanguageFeatures/Super-parameters/semantics_A04_t10.dart b/LanguageFeatures/Super-parameters/semantics_A04_t10.dart
new file mode 100644
index 0000000..16692ad
--- /dev/null
+++ b/LanguageFeatures/Super-parameters/semantics_A04_t10.dart
@@ -0,0 +1,27 @@
+// Copyright (c) 2021, the Dart project authors. Please see the AUTHORS file
+// 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.
+
+/// @assertion It’s a compile-time error if a constructor (or any function) has
+/// two parameter declarations with the same name.
+///
+/// @description Check that it is a compile-time error if a constructor has
+/// two parameter declarations with the same name.
+/// @author sgrekhov@unipro.ru
+
+// SharedOptions=--enable-experiment=super-parameters
+class S {
+ int s1, s2;
+ S(this.s1, [this.s2 = 0]);
+}
+
+class C extends S {
+ int i1;
+ C(this.i1, super.s1, super.s2, {super.s2 = -1});
+// ^^^^^^^^
+// [analyzer] unspecified
+// [cfe] unspecified
+}
+main() {
+ C(1, 2, 3);
+}
diff --git a/LanguageFeatures/Super-parameters/semantics_A04_t11.dart b/LanguageFeatures/Super-parameters/semantics_A04_t11.dart
new file mode 100644
index 0000000..d79a412
--- /dev/null
+++ b/LanguageFeatures/Super-parameters/semantics_A04_t11.dart
@@ -0,0 +1,27 @@
+// Copyright (c) 2021, the Dart project authors. Please see the AUTHORS file
+// 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.
+
+/// @assertion It’s a compile-time error if a constructor (or any function) has
+/// two parameter declarations with the same name.
+///
+/// @description Check that it is a compile-time error if a constructor has
+/// two parameter declarations with the same name.
+/// @author sgrekhov@unipro.ru
+
+// SharedOptions=--enable-experiment=super-parameters
+class S {
+ int s1, s2;
+ S(this.s1, {this.s2 = 0});
+}
+
+class C extends S {
+ int i1;
+ C(this.i1, super.s1, super.s2, {super.s2});
+// ^^^^^^^^
+// [analyzer] unspecified
+// [cfe] unspecified
+}
+main() {
+ C(1, 2, 3);
+}
diff --git a/LanguageFeatures/Super-parameters/semantics_A04_t12.dart b/LanguageFeatures/Super-parameters/semantics_A04_t12.dart
new file mode 100644
index 0000000..7e6e4aa
--- /dev/null
+++ b/LanguageFeatures/Super-parameters/semantics_A04_t12.dart
@@ -0,0 +1,27 @@
+// Copyright (c) 2021, the Dart project authors. Please see the AUTHORS file
+// 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.
+
+/// @assertion It’s a compile-time error if a constructor (or any function) has
+/// two parameter declarations with the same name.
+///
+/// @description Check that it is a compile-time error if a constructor has
+/// two parameter declarations with the same name.
+/// @author sgrekhov@unipro.ru
+
+// SharedOptions=--enable-experiment=super-parameters
+class S {
+ int s1, s2;
+ S(this.s1, {this.s2 = 0});
+}
+
+class C extends S {
+ int i1;
+ C(this.i1, super.s1, {super.s2, super.s2});
+// ^^^^^^^^
+// [analyzer] unspecified
+// [cfe] unspecified
+}
+main() {
+ C(1, 2, 3);
+}