Fixes #1193. Add constant expression tests for explicit generics instantiation
diff --git a/LanguageFeatures/Constructor-tear-offs/call_method_A03_t03.dart b/LanguageFeatures/Constructor-tear-offs/call_method_A03_t03.dart
deleted file mode 100644
index 1393018..0000000
--- a/LanguageFeatures/Constructor-tear-offs/call_method_A03_t03.dart
+++ /dev/null
@@ -1,40 +0,0 @@
-// 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 For an expression of the form e<typeArgs>, which is not followed
-/// by an argument list (that would turn it into a generic function invocation),
-/// the meaning of e<typeArgs> depends on the expression e:
-/// ...
-/// - If e has a static type which is a generic callable object type (a
-/// non-function type with a generic method named call), then e<typeArgs> is
-/// equivalent to the instantiated method-tear off e.call<typeArgs>.
-/// - Otherwise, if e has a static type which is a generic function type, then
-/// e<typeArgs> is equivalent to the instantiated method-tear off
-/// e.call<typeArgs>
-///
-/// @description Checks that it is not an error to tear-off a call method of a
-/// generic function type using super.
-/// @author sgrekhov@unipro.ru
-/// @issue 46902
-
-// SharedOptions=--enable-experiment=constructor-tearoffs
-
-import "../../Utils/expect.dart";
-
-typedef int Foo(int i);
-
-class A {
-  T foo<T>(T value) => value;
-}
-
-class C extends A {
-  Foo getCall1() => super.foo.call<int>;
-  Foo getCall2() => super.foo.call;
-}
-
-main() {
-  C c = new C();
-  Expect.equals(42, c.getCall1()(42));
-  Expect.equals(42, c.getCall2()(42));
-}
diff --git a/LanguageFeatures/Constructor-tear-offs/constant_A01_t01.dart b/LanguageFeatures/Constructor-tear-offs/constant_A01_t01.dart
new file mode 100644
index 0000000..633dbf4
--- /dev/null
+++ b/LanguageFeatures/Constructor-tear-offs/constant_A01_t01.dart
@@ -0,0 +1,28 @@
+// 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 An expression is constant if it is an explicit generic type
+/// instantiation of a constant function object where the type argument is
+/// constant
+///
+/// @description Check that an expression is constant if it is an explicit
+/// generic type instantiation of a constant function object where the type
+/// argument is constant
+/// @author sgrekhov@unipro.ru
+
+// SharedOptions=--enable-experiment=constructor-tearoffs
+
+import "../../Utils/expect.dart";
+
+X f<X>(X x) => x;
+
+typedef IntAlias = int;
+
+void main() {
+  const c1 = f<int>;
+  Expect.equals(42, c1(42));
+
+  const c2 = f<IntAlias>;
+  Expect.equals(42, c2(42));
+}
\ No newline at end of file
diff --git a/LanguageFeatures/Constructor-tear-offs/constant_A01_t02.dart b/LanguageFeatures/Constructor-tear-offs/constant_A01_t02.dart
new file mode 100644
index 0000000..4fad86f
--- /dev/null
+++ b/LanguageFeatures/Constructor-tear-offs/constant_A01_t02.dart
@@ -0,0 +1,25 @@
+// 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 An expression is constant if it is an explicit generic type
+/// instantiation of a constant function object where the type argument is
+/// constant
+///
+/// @description Check that an expression is constant if it is an explicit
+/// generic type instantiation of a constant function object where the type
+/// argument is constant
+/// @author sgrekhov@unipro.ru
+
+// SharedOptions=--enable-experiment=constructor-tearoffs
+
+import "../../Utils/expect.dart";
+
+class C {
+  static X bar<X>(X x) => x;
+}
+
+void main() {
+  const c1 = C.bar<int>;
+  Expect.equals(42, c1(42));
+}
diff --git a/LanguageFeatures/Constructor-tear-offs/constant_A02_t01.dart b/LanguageFeatures/Constructor-tear-offs/constant_A02_t01.dart
new file mode 100644
index 0000000..111f4a3
--- /dev/null
+++ b/LanguageFeatures/Constructor-tear-offs/constant_A02_t01.dart
@@ -0,0 +1,42 @@
+// 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 An expression is constant if it is an explicit generic type
+/// instantiation of a constant function object where the type argument is
+/// constant
+///
+/// @description Check that an expression is constant if it is an explicit
+/// generic type instantiation of a constant function object where the type
+/// argument is constant
+/// @author sgrekhov@unipro.ru
+
+// SharedOptions=--enable-experiment=constructor-tearoffs
+
+void f<X>(X x) {}
+
+void main() {
+  void g1<Y>() {
+    const c1 = f<Y>;
+//             ^^^^
+// [analyzer] unspecified
+// [cfe] unspecified
+  }
+
+  const c2 = g1<int>;
+//           ^^^^^^^
+// [analyzer] unspecified
+// [cfe] unspecified
+
+  void g2<Y extends num>() {
+  const c3 = f<Y>;
+//           ^^^^
+// [analyzer] unspecified
+// [cfe] unspecified
+  }
+
+  const c4 = g2<int>;
+//           ^^^^^^^
+// [analyzer] unspecified
+// [cfe] unspecified
+}
diff --git a/LanguageFeatures/Constructor-tear-offs/constant_A02_t02.dart b/LanguageFeatures/Constructor-tear-offs/constant_A02_t02.dart
new file mode 100644
index 0000000..71618c1
--- /dev/null
+++ b/LanguageFeatures/Constructor-tear-offs/constant_A02_t02.dart
@@ -0,0 +1,23 @@
+// 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 An expression is constant if it is an explicit generic type
+/// instantiation of a constant function object where the type argument is
+/// constant
+///
+/// @description Check that an expression is constant if it is an explicit
+/// generic type instantiation of a constant function object where the type
+/// argument is constant
+/// @author sgrekhov@unipro.ru
+
+// SharedOptions=--enable-experiment=constructor-tearoffs
+
+void main() {
+  var f = <X>(X x) {};
+
+  const c = f<int>;
+//          ^^^^^^^
+// [analyzer] unspecified
+// [cfe] unspecified
+}
diff --git a/LanguageFeatures/Constructor-tear-offs/constant_A02_t03.dart b/LanguageFeatures/Constructor-tear-offs/constant_A02_t03.dart
new file mode 100644
index 0000000..8c17466
--- /dev/null
+++ b/LanguageFeatures/Constructor-tear-offs/constant_A02_t03.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 An expression is constant if it is an explicit generic type
+/// instantiation of a constant function object where the type argument is
+/// constant
+///
+/// @description Check that an expression is constant if it is an explicit
+/// generic type instantiation of a constant function object where the type
+/// argument is constant
+/// @author sgrekhov@unipro.ru
+
+// SharedOptions=--enable-experiment=constructor-tearoffs
+
+class C {
+  const C();
+  void foo<X>(X x) {}
+}
+
+void main() {
+  const c = const C();
+  const c1 = c.foo<int>;
+//           ^^^^^^^^^^
+// [analyzer] unspecified
+// [cfe] unspecified
+}