Fixed Issues #397, #398: tests for static extension methods added (generic parameter interfaces and extension conflict resolution)
diff --git a/LanguageFeatures/Extension-methods/extension_conflict_resolution_A01_t01.dart b/LanguageFeatures/Extension-methods/extension_conflict_resolution_A01_t01.dart
new file mode 100644
index 0000000..af4f776
--- /dev/null
+++ b/LanguageFeatures/Extension-methods/extension_conflict_resolution_A01_t01.dart
@@ -0,0 +1,30 @@
+/*
+ * Copyright (c) 2019, 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 If more than one extension applies to a specific member
+ * invocation, then we resort to a heuristic to choose one of the extensions to
+ * apply. If exactly one of them is "more specific" than all the others, that
+ * one is chosen. Otherwise it is a compile-time error.
+ * @description Check that compile time error is thrown if two extension members
+ * are equitable
+ * @compile-error
+ * @author iarkh@unipro.ru
+ */
+// SharedOptions=--enable-experiment=extension-methods
+
+extension TypedEquals1<T> {
+  bool equals(T value) => this == value;
+}
+
+extension TypedEquals2<T> {
+  bool equals(T value) => true;
+}
+
+String str1, str2;
+
+main() {
+  str1.equals(str2);
+}
diff --git a/LanguageFeatures/Extension-methods/extension_conflict_resolution_A02_t01.dart b/LanguageFeatures/Extension-methods/extension_conflict_resolution_A02_t01.dart
new file mode 100644
index 0000000..ad87198
--- /dev/null
+++ b/LanguageFeatures/Extension-methods/extension_conflict_resolution_A02_t01.dart
@@ -0,0 +1,32 @@
+/*
+ * Copyright (c) 2019, 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 If more than one extension applies to a specific member
+ * invocation, then we resort to a heuristic to choose one of the extensions to
+ * apply. If exactly one of them is "more specific" than all the others, that
+ * one is chosen. Otherwise it is a compile-time error.
+ * An extension with [on] type clause [T1] is more specific than another
+ * extension with [on] type clause [T2] iff
+ *   1. The latter extension is declared in a platform library, and the former
+ *   extension is not
+ * @description Check that compile time error is thrown if two extension members
+ * are equitable
+ * @compile-error
+ * @author iarkh@unipro.ru
+ */
+// SharedOptions=--enable-experiment=extension-methods
+
+import "extension_conflict_resolution_lib.dart";
+import "../../Utils/expect.dart";
+
+extension MyFancyList<T> on List<T> {
+  bool get isLibraryVersion => false;
+}
+
+main() {
+  List aList = [];
+  Expect.isFalse(aList.isLibraryVersion);
+}
diff --git a/LanguageFeatures/Extension-methods/extension_conflict_resolution_lib.dart b/LanguageFeatures/Extension-methods/extension_conflict_resolution_lib.dart
new file mode 100644
index 0000000..de2f3e6
--- /dev/null
+++ b/LanguageFeatures/Extension-methods/extension_conflict_resolution_lib.dart
@@ -0,0 +1,11 @@
+/*
+ * Copyright (c) 2019, 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.
+ */
+// SharedOptions=--enable-experiment=extension-methods
+library extension_conflict_resolution_lib;
+
+extension MyFancyList<T> on List<T> {
+  bool get isLibraryVersion => true;
+}
diff --git a/LanguageFeatures/Extension-methods/generic_parameter_inference_A02_t01.dart b/LanguageFeatures/Extension-methods/generic_parameter_inference_A02_t01.dart
new file mode 100644
index 0000000..6644251
--- /dev/null
+++ b/LanguageFeatures/Extension-methods/generic_parameter_inference_A02_t01.dart
@@ -0,0 +1,45 @@
+/*
+ * Copyright (c) 2019, 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 The extension type parameter can also occur as a parameter type
+ * for the method.
+ *
+ *   Example:
+ *
+ *   extension TypedEquals<T> {
+ *     bool equals(T value) => this == value;
+ *   }
+ *
+ * Using such an extension as:
+ *
+ *   Object o = ...;
+ *   String s = ...;
+ *   print(s.equals(o));  // Compile-time type error.
+ *
+ * will fail. While we could make it work by inferring [T] as [Object], we
+ * don't. We infer [T] only based on the receiver type, and therefore [T] is
+ * [String], and [o] is not a valid argument (at least not when we remove
+ * implicit downcasts).
+ * @description Check that compile time error is thrown when method type
+ * parameter is incorrect.
+ * @compile-error
+ * @author iarkh@unipro.ru
+ */
+// SharedOptions=--enable-experiment=extension-methods
+
+Object getObject() => new Object();
+String getString() => "OK";
+
+extension TypedEquals<T> {
+  bool equals(T value) => this == value;
+}
+
+main() {
+  String s = getString();
+  Object o = getObject();
+
+  bool b = s.equals(o);
+}
diff --git a/LanguageFeatures/Extension-methods/generic_parameter_inference_A02_t02.dart b/LanguageFeatures/Extension-methods/generic_parameter_inference_A02_t02.dart
new file mode 100644
index 0000000..c8e9c7b
--- /dev/null
+++ b/LanguageFeatures/Extension-methods/generic_parameter_inference_A02_t02.dart
@@ -0,0 +1,46 @@
+/*
+ * Copyright (c) 2019, 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 The extension type parameter can also occur as a parameter type
+ * for the method.
+ *
+ *   Example:
+ *
+ *   extension TypedEquals<T> {
+ *     bool equals(T value) => this == value;
+ *   }
+ *
+ * Using such an extension as:
+ *
+ *   Object o = ...;
+ *   String s = ...;
+ *   print(s.equals(o));  // Compile-time type error.
+ *
+ * will fail. While we could make it work by inferring [T] as [Object], we
+ * don't. We infer [T] only based on the receiver type, and therefore [T] is
+ * [String], and [o] is not a valid argument (at least not when we remove
+ * implicit downcasts).
+ * @description Check that compile time error is not thrown when method type
+ * parameter is OK.
+ * @author iarkh@unipro.ru
+ */
+// SharedOptions=--enable-experiment=extension-methods
+
+import "../../Utils/expect.dart";
+
+Object getObject() => new Object();
+String getString() => "OK";
+
+extension TypedEquals<T> {
+  bool equals(T value) => this == value;
+}
+
+main() {
+  String s = getString();
+  Object o = getObject();
+
+  Expect.isFalse(o.equals(s));
+}