Add const and factory constructors tests for constructor 'new' syntax
diff --git a/LanguageFeatures/Constructor-tear-offs/unnamed_constructor_A03_t01.dart b/LanguageFeatures/Constructor-tear-offs/unnamed_constructor_A03_t01.dart
index c03f38b..6e35469 100644
--- a/LanguageFeatures/Constructor-tear-offs/unnamed_constructor_A03_t01.dart
+++ b/LanguageFeatures/Constructor-tear-offs/unnamed_constructor_A03_t01.dart
@@ -22,7 +22,7 @@
}
main() {
- A a = A.new();
+ A.new();
Expect.equals(1, A.called);
A();
diff --git a/LanguageFeatures/Constructor-tear-offs/unnamed_constructor_A03_t07.dart b/LanguageFeatures/Constructor-tear-offs/unnamed_constructor_A08_t01.dart
similarity index 81%
rename from LanguageFeatures/Constructor-tear-offs/unnamed_constructor_A03_t07.dart
rename to LanguageFeatures/Constructor-tear-offs/unnamed_constructor_A08_t01.dart
index ca33fd7..7d64118 100644
--- a/LanguageFeatures/Constructor-tear-offs/unnamed_constructor_A03_t07.dart
+++ b/LanguageFeatures/Constructor-tear-offs/unnamed_constructor_A08_t01.dart
@@ -2,9 +2,8 @@
// 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 If [C] denotes a class, an expression of [C] by itself already
-/// has a meaning, it evaluates to a [Type] object representing the class, so it
-/// cannot also denote the unnamed constructor.
+/// @assertion You cannot have both a C and a C.new constructor declaration in
+/// the same class, they denote the same constructor
///
/// @description Checks that it's impossible to have default constructors
/// declared with [new] syntax and with class name at the same time.
diff --git a/LanguageFeatures/Constructor-tear-offs/unnamed_constructor_A08_t02.dart b/LanguageFeatures/Constructor-tear-offs/unnamed_constructor_A08_t02.dart
new file mode 100644
index 0000000..cddd519
--- /dev/null
+++ b/LanguageFeatures/Constructor-tear-offs/unnamed_constructor_A08_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 You cannot have both a C and a C.new constructor declaration in
+/// the same class, they denote the same constructor
+///
+/// @description Checks that it's impossible to have default constructors
+/// declared with [new] syntax and with class name at the same time. Test
+/// constant constructor
+///
+/// @author iarkh@unipro.ru
+
+// SharedOptions=--enable-experiment=constructor-tearoffs
+
+class A1 {
+ A1() {}
+ const A1.new();
+// ^^^^^^
+// [analyzer] unspecified
+// [cfe] unspecified
+}
+
+class A2 {
+ const A2.new();
+ A2() {}
+//^^
+// [analyzer] unspecified
+// [cfe] unspecified
+}
+
+class B1 {
+ const B1();
+ B1.new() {}
+//^^^^^^
+// [analyzer] unspecified
+// [cfe] unspecified
+}
+
+class B2 {
+ B2.new() {}
+ const B2();
+// ^^
+// [analyzer] unspecified
+// [cfe] unspecified
+}
+
+class C1 {
+ const C1();
+ const C1.new();
+// ^^^^^
+// [analyzer] unspecified
+// [cfe] unspecified
+}
+
+class C2 {
+ const C2.new();
+ const C2();
+// ^^
+// [analyzer] unspecified
+// [cfe] unspecified
+}
+
+main() {}
diff --git a/LanguageFeatures/Constructor-tear-offs/unnamed_constructor_A08_t03.dart b/LanguageFeatures/Constructor-tear-offs/unnamed_constructor_A08_t03.dart
new file mode 100644
index 0000000..c6cf8ab
--- /dev/null
+++ b/LanguageFeatures/Constructor-tear-offs/unnamed_constructor_A08_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 You cannot have both a C and a C.new constructor declaration in
+/// the same class, they denote the same constructor
+///
+/// @description Checks that it's impossible to have default constructors
+/// declared with [new] syntax and with class name at the same time. Test
+/// factory constructor
+///
+/// @author iarkh@unipro.ru
+
+// SharedOptions=--enable-experiment=constructor-tearoffs
+
+class C1 {
+ C1();
+ factory C1.new() = D1;
+// ^^^^^^
+// [analyzer] unspecified
+// [cfe] unspecified
+}
+
+class D1 extends C1 {
+ D1();
+}
+
+class C2 {
+ C2.new();
+ factory C2() = D2;
+// ^^
+// [analyzer] unspecified
+// [cfe] unspecified
+}
+
+class D2 extends C2 {
+ D2();
+}
+
+main() {}