#1231. Super parameters type inference tests added
diff --git a/LanguageFeatures/Super-parameters/type_inference_A01_t01.dart b/LanguageFeatures/Super-parameters/type_inference_A01_t01.dart
new file mode 100644
index 0000000..602d423
--- /dev/null
+++ b/LanguageFeatures/Super-parameters/type_inference_A01_t01.dart
@@ -0,0 +1,39 @@
+// 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 We infer the type of a parameter declaration, p, of a
+/// non-redirecting generative constructor, C, as:
+///
+/// If the p has a type in its <finalConstVarOrType>, that remains the type of
+/// the parameter.
+///
+/// @description Check that if the p has a type in its <finalConstVarOrType>,
+/// that remains the type of the parameter.
+/// @author sgrekhov@unipro.ru
+
+import "../../Utils/expect.dart";
+
+test<T>(T t) {}
+
+class C<T> {
+ C(final f, var v, int i, T t) {
+ test<int>(f);
+ test<int>(v);
+ test<int>(i);
+ test<T>(t);
+
+ Expect.isTrue(f is int);
+ Expect.isFalse(f is String);
+ Expect.isTrue(v is int);
+ Expect.isFalse(v is String);
+ Expect.isTrue(i is int);
+ Expect.isFalse(i is String);
+ Expect.isTrue(t is int);
+ Expect.isFalse(t is String);
+ }
+}
+
+main() {
+ C(1, 2, 3, 4);
+}
diff --git a/LanguageFeatures/Super-parameters/type_inference_A01_t02.dart b/LanguageFeatures/Super-parameters/type_inference_A01_t02.dart
new file mode 100644
index 0000000..aca309d
--- /dev/null
+++ b/LanguageFeatures/Super-parameters/type_inference_A01_t02.dart
@@ -0,0 +1,34 @@
+// 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 We infer the type of a parameter declaration, p, of a
+/// non-redirecting generative constructor, C, as:
+///
+/// If the p has a type in its <finalConstVarOrType>, that remains the type of
+/// the parameter.
+///
+/// @description Check that if the p has a type in its <finalConstVarOrType>,
+/// that remains the type of the parameter.
+/// @author sgrekhov@unipro.ru
+
+test<T>(T t) {}
+
+class C<T> {
+ C(final f, var v, int i, T t) {
+ test<String>(f);
+ test<String>(v);
+ test<String>(i);
+// ^
+// [analyzer] unspecified
+// [cfe] unspecified
+ test<String>(t);
+// ^
+// [analyzer] unspecified
+// [cfe] unspecified
+ }
+}
+
+main() {
+ C(1, 2, 3, 4);
+}
diff --git a/LanguageFeatures/Super-parameters/type_inference_A02_t01.dart b/LanguageFeatures/Super-parameters/type_inference_A02_t01.dart
new file mode 100644
index 0000000..d76fa8d
--- /dev/null
+++ b/LanguageFeatures/Super-parameters/type_inference_A02_t01.dart
@@ -0,0 +1,46 @@
+// 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 We infer the type of a parameter declaration, p, of a
+/// non-redirecting generative constructor, C, as:
+/// ...
+/// Otherwise, if the parameter is an initializing formal (this.name) the
+/// inferred type of the parameter is the declared/inferred type of the instance
+/// variable named name of the surrounding class (which must exist, otherwise
+/// it’s a compile-time error.)
+///
+/// @description Check that if the parameter is an initializing formal
+/// (this.name) the inferred type of the parameter is the declared/inferred type
+/// of the instance variable named name of the surrounding class
+/// @author sgrekhov@unipro.ru
+
+import "../../Utils/expect.dart";
+
+test<T>(T t) {}
+
+class C<T> {
+ final f;
+ var v;
+ int i;
+ T t;
+ C(this.f, this.v, this.i, this.t) {
+ test<int>(this.f);
+ test<int>(this.v);
+ test<int>(this.i);
+ test<T>(this.t);
+
+ Expect.isTrue(f is int);
+ Expect.isFalse(f is String);
+ Expect.isTrue(v is int);
+ Expect.isFalse(v is String);
+ Expect.isTrue(i is int);
+ Expect.isFalse(i is String);
+ Expect.isTrue(t is int);
+ Expect.isFalse(t is String);
+ }
+}
+
+main() {
+ C(1, 2, 3, 4);
+}
diff --git a/LanguageFeatures/Super-parameters/type_inference_A02_t02.dart b/LanguageFeatures/Super-parameters/type_inference_A02_t02.dart
new file mode 100644
index 0000000..8611d67
--- /dev/null
+++ b/LanguageFeatures/Super-parameters/type_inference_A02_t02.dart
@@ -0,0 +1,41 @@
+// 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 We infer the type of a parameter declaration, p, of a
+/// non-redirecting generative constructor, C, as:
+/// ...
+/// Otherwise, if the parameter is an initializing formal (this.name) the
+/// inferred type of the parameter is the declared/inferred type of the instance
+/// variable named name of the surrounding class (which must exist, otherwise
+/// it’s a compile-time error.)
+///
+/// @description Check that if the parameter is an initializing formal
+/// (this.name) the inferred type of the parameter is the declared/inferred type
+/// of the instance variable named name of the surrounding class
+/// @author sgrekhov@unipro.ru
+
+test<T>(T t) {}
+
+class C<T> {
+ final f;
+ var v;
+ int i;
+ T t;
+ C(this.f, this.v, this.i, this.t) {
+ test<String>(this.f);
+ test<String>(this.v);
+ test<String>(this.i);
+// ^^^^^^
+// [analyzer] unspecified
+// [cfe] unspecified
+ test<String>(this.t);
+// ^^^^^^
+// [analyzer] unspecified
+// [cfe] unspecified
+ }
+}
+
+main() {
+ C(1, 2, 3, 4);
+}
diff --git a/LanguageFeatures/Super-parameters/type_inference_A03_t01.dart b/LanguageFeatures/Super-parameters/type_inference_A03_t01.dart
new file mode 100644
index 0000000..fc66193
--- /dev/null
+++ b/LanguageFeatures/Super-parameters/type_inference_A03_t01.dart
@@ -0,0 +1,64 @@
+// 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 We infer the type of a parameter declaration, p, of a
+/// non-redirecting generative constructor, C, as:
+/// ...
+/// Otherwise, if the parameter is a super parameter (super.name) the inferred
+/// type of the parameter is the associated super-constructor parameter (which
+/// must exist, otherwise we’d have a compile-time error).
+///
+/// @description Check that if the parameter is a super parameter (super.name)
+/// the inferred type of the parameter is the associated super-constructor
+/// parameter
+/// @author sgrekhov@unipro.ru
+
+import "../../Utils/expect.dart";
+
+test<T>(T t) {}
+
+class S<T> {
+ final f1;
+ var v1;
+ int i1;
+ T t1;
+ S(this.f1, this.v1, this.i1, this.t1);
+}
+
+class C<T> extends S<T> {
+ final f2;
+ var v2;
+ int i2;
+ T t2;
+ C(super.f1, super.v1, super.i1, super.t1, this.f2, this.v2, this.i2, this.t2);
+}
+
+main() {
+ var c = C(1, 2, 3, 4, 5, 6, 7, 8);
+ test<int>(c.f1);
+ test<int>(c.v1);
+ test<int>(c.i1);
+ test<int>(c.t1);
+ test<int>(c.f2);
+ test<int>(c.v2);
+ test<int>(c.i2);
+ test<int>(c.t2);
+
+ Expect.isTrue(c.f1 is int);
+ Expect.isFalse(c.f1 is String);
+ Expect.isTrue(c.v1 is int);
+ Expect.isFalse(c.v1 is String);
+ Expect.isTrue(c.i1 is int);
+ Expect.isFalse(c.i1 is String);
+ Expect.isTrue(c.t1 is int);
+ Expect.isFalse(c.t1 is String);
+ Expect.isTrue(c.f2 is int);
+ Expect.isFalse(c.f2 is String);
+ Expect.isTrue(c.v2 is int);
+ Expect.isFalse(c.v2 is String);
+ Expect.isTrue(c.i2 is int);
+ Expect.isFalse(c.i2 is String);
+ Expect.isTrue(c.t2 is int);
+ Expect.isFalse(c.t2 is String);
+}
diff --git a/LanguageFeatures/Super-parameters/type_inference_A03_t02.dart b/LanguageFeatures/Super-parameters/type_inference_A03_t02.dart
new file mode 100644
index 0000000..3bc26d7
--- /dev/null
+++ b/LanguageFeatures/Super-parameters/type_inference_A03_t02.dart
@@ -0,0 +1,64 @@
+// 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 We infer the type of a parameter declaration, p, of a
+/// non-redirecting generative constructor, C, as:
+/// ...
+/// Otherwise, if the parameter is a super parameter (super.name) the inferred
+/// type of the parameter is the associated super-constructor parameter (which
+/// must exist, otherwise we’d have a compile-time error).
+///
+/// @description Check that if the parameter is a super parameter (super.name)
+/// the inferred type of the parameter is the associated super-constructor
+/// parameter
+/// @author sgrekhov@unipro.ru
+
+import "../../Utils/expect.dart";
+
+test<T>(T t) {}
+
+class S<T> {
+ final f1;
+ var v1;
+ int i1;
+ T t1;
+ S(this.f1, this.v1, this.i1, this.t1);
+}
+
+class C<T> extends S<T> {
+ final f2;
+ var v2;
+ int i2;
+ T t2;
+ C(super.f1, super.v1, super.i1, super.t1, this.f2, this.v2, this.i2, this.t2);
+}
+
+main() {
+ C<int> c = C<int>(1, 2, 3, 4, 5, 6, 7, 8);
+ test<int>(c.f1);
+ test<int>(c.v1);
+ test<int>(c.i1);
+ test<int>(c.t1);
+ test<int>(c.f2);
+ test<int>(c.v2);
+ test<int>(c.i2);
+ test<int>(c.t2);
+
+ Expect.isTrue(c.f1 is int);
+ Expect.isFalse(c.f1 is String);
+ Expect.isTrue(c.v1 is int);
+ Expect.isFalse(c.v1 is String);
+ Expect.isTrue(c.i1 is int);
+ Expect.isFalse(c.i1 is String);
+ Expect.isTrue(c.t1 is int);
+ Expect.isFalse(c.t1 is String);
+ Expect.isTrue(c.f2 is int);
+ Expect.isFalse(c.f2 is String);
+ Expect.isTrue(c.v2 is int);
+ Expect.isFalse(c.v2 is String);
+ Expect.isTrue(c.i2 is int);
+ Expect.isFalse(c.i2 is String);
+ Expect.isTrue(c.t2 is int);
+ Expect.isFalse(c.t2 is String);
+}
diff --git a/LanguageFeatures/Super-parameters/type_inference_A03_t03.dart b/LanguageFeatures/Super-parameters/type_inference_A03_t03.dart
new file mode 100644
index 0000000..6334f36
--- /dev/null
+++ b/LanguageFeatures/Super-parameters/type_inference_A03_t03.dart
@@ -0,0 +1,64 @@
+// 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 We infer the type of a parameter declaration, p, of a
+/// non-redirecting generative constructor, C, as:
+/// ...
+/// Otherwise, if the parameter is a super parameter (super.name) the inferred
+/// type of the parameter is the associated super-constructor parameter (which
+/// must exist, otherwise we’d have a compile-time error).
+///
+/// @description Check that if the parameter is a super parameter (super.name)
+/// the inferred type of the parameter is the associated super-constructor
+/// parameter
+/// @author sgrekhov@unipro.ru
+
+import "../../Utils/expect.dart";
+
+test<T>(T t) {}
+
+class S<T> {
+ final f1;
+ var v1;
+ int? i1;
+ T? t1;
+ S([this.f1, this.v1, this.i1, this.t1]);
+}
+
+class C<T> extends S<T> {
+ final f2;
+ var v2;
+ int? i2;
+ T? t2;
+ C([super.f1, super.v1, super.i1, super.t1, this.f2, this.v2, this.i2, this.t2]);
+}
+
+main() {
+ var c = C(1, 2, 3, 4, 5, 6, 7, 8);
+ test<int>(c.f1);
+ test<int>(c.v1);
+ test<int?>(c.i1);
+ test<int>(c.t1);
+ test<int>(c.f2);
+ test<int>(c.v2);
+ test<int?>(c.i2);
+ test<int>(c.t2);
+
+ Expect.isTrue(c.f1 is int);
+ Expect.isFalse(c.f1 is String);
+ Expect.isTrue(c.v1 is int);
+ Expect.isFalse(c.v1 is String);
+ Expect.isTrue(c.i1 is int?);
+ Expect.isFalse(c.i1 is String);
+ Expect.isTrue(c.t1 is int);
+ Expect.isFalse(c.t1 is String);
+ Expect.isTrue(c.f2 is int);
+ Expect.isFalse(c.f2 is String);
+ Expect.isTrue(c.v2 is int);
+ Expect.isFalse(c.v2 is String);
+ Expect.isTrue(c.i2 is int?);
+ Expect.isFalse(c.i2 is String);
+ Expect.isTrue(c.t2 is int);
+ Expect.isFalse(c.t2 is String);
+}
diff --git a/LanguageFeatures/Super-parameters/type_inference_A04_t01.dart b/LanguageFeatures/Super-parameters/type_inference_A04_t01.dart
new file mode 100644
index 0000000..650db22
--- /dev/null
+++ b/LanguageFeatures/Super-parameters/type_inference_A04_t01.dart
@@ -0,0 +1,40 @@
+// 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 We infer the type of a parameter declaration, p, of a
+/// non-redirecting generative constructor, C, as:
+/// ...
+/// Otherwise the inferred type of the parameter is dynamic
+///
+/// @description Check that the inferred type of the parameter is dynamic if
+/// there is no information about the parameter type
+/// @author sgrekhov@unipro.ru
+
+import "../../Utils/expect.dart";
+
+class C<T> {
+ var x;
+ T t;
+ C(var v, this.x, this.t) {
+ Expect.throws(() {
+ testType(v);
+ });
+ }
+}
+
+test(var v) {
+ var c = C(v, v, v);
+ Expect.throws(() {
+ testType(c.x);
+ });
+ Expect.throws(() {
+ testType(c.t);
+ });
+}
+
+testType(String s) {}
+
+main() {
+ test(42);
+}
diff --git a/LanguageFeatures/Super-parameters/type_inference_A04_t02.dart b/LanguageFeatures/Super-parameters/type_inference_A04_t02.dart
new file mode 100644
index 0000000..fff654c
--- /dev/null
+++ b/LanguageFeatures/Super-parameters/type_inference_A04_t02.dart
@@ -0,0 +1,40 @@
+// 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 We infer the type of a parameter declaration, p, of a
+/// non-redirecting generative constructor, C, as:
+/// ...
+/// Otherwise the inferred type of the parameter is dynamic
+///
+/// @description Check that the inferred type of the parameter is dynamic if
+/// there is no information about the parameter type
+/// @author sgrekhov@unipro.ru
+
+import "../../Utils/expect.dart";
+
+class S<T> {
+ var x;
+ T t;
+ S(this.x, this.t);
+}
+
+class C<T> extends S<T> {
+ C(super.x, super.t);
+}
+
+test(var v) {
+ var c = C(v, v);
+ Expect.throws(() {
+ testType(c.x);
+ });
+ Expect.throws(() {
+ testType(c.t);
+ });
+}
+
+testType(String s) {}
+
+main() {
+ test(42);
+}
diff --git a/LanguageFeatures/Super-parameters/type_inference_A04_t03.dart b/LanguageFeatures/Super-parameters/type_inference_A04_t03.dart
new file mode 100644
index 0000000..fb0b83f
--- /dev/null
+++ b/LanguageFeatures/Super-parameters/type_inference_A04_t03.dart
@@ -0,0 +1,40 @@
+// 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 We infer the type of a parameter declaration, p, of a
+/// non-redirecting generative constructor, C, as:
+/// ...
+/// Otherwise the inferred type of the parameter is dynamic
+///
+/// @description Check that the inferred type of the parameter is dynamic if
+/// there is no information about the parameter type
+/// @author sgrekhov@unipro.ru
+
+import "../../Utils/expect.dart";
+
+class S<T> {
+ var x;
+ T t;
+ S({required this.x, required this.t});
+}
+
+class C<T> extends S<T> {
+ C({required super.x, required super.t});
+}
+
+test(var v) {
+ var c = C(x: v, t: v);
+ Expect.throws(() {
+ testType(c.x);
+ });
+ Expect.throws(() {
+ testType(c.t);
+ });
+}
+
+testType(String s) {}
+
+main() {
+ test(42);
+}
diff --git a/LanguageFeatures/Super-parameters/type_inference_A04_t04.dart b/LanguageFeatures/Super-parameters/type_inference_A04_t04.dart
new file mode 100644
index 0000000..a73de47
--- /dev/null
+++ b/LanguageFeatures/Super-parameters/type_inference_A04_t04.dart
@@ -0,0 +1,40 @@
+// 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 We infer the type of a parameter declaration, p, of a
+/// non-redirecting generative constructor, C, as:
+/// ...
+/// Otherwise the inferred type of the parameter is dynamic
+///
+/// @description Check that the inferred type of the parameter is dynamic if
+/// there is no information about the parameter type
+/// @author sgrekhov@unipro.ru
+
+import "../../Utils/expect.dart";
+
+class S<T> {
+ var x;
+ T? t;
+ S([this.x, this.t]);
+}
+
+class C<T> extends S<T> {
+ C([super.x, super.t]);
+}
+
+test(var v) {
+ var c = C(v, v);
+ Expect.throws(() {
+ testType(c.x);
+ });
+ Expect.throws(() {
+ testType(c.t);
+ });
+}
+
+testType(String s) {}
+
+main() {
+ test(42);
+}