Adds some more tests for mixins.

Change-Id: If7915de3ff86cfdf4629d5fedac22488724b7972
Reviewed-on: https://dart-review.googlesource.com/72441
Commit-Queue: Daniel Hillerström <hillerstrom@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
diff --git a/tests/language_2/language_2_analyzer.status b/tests/language_2/language_2_analyzer.status
index b2e72b6..520b638 100644
--- a/tests/language_2/language_2_analyzer.status
+++ b/tests/language_2/language_2_analyzer.status
@@ -78,6 +78,7 @@
 mixin_forwarding_constructor4_test/01: CompileTimeError # See issue 15101
 mixin_forwarding_constructor4_test/02: CompileTimeError # See issue 15101
 mixin_forwarding_constructor4_test/03: CompileTimeError # See issue 15101
+mixin_method_override_test/01: MissingCompileTimeError
 mixin_super_2_test/01: MissingCompileTimeError
 mixin_super_2_test/03: MissingCompileTimeError
 mixin_super_constructor_named_test/01: CompileTimeError # See issue 15101
diff --git a/tests/language_2/language_2_dart2js.status b/tests/language_2/language_2_dart2js.status
index f997b19..25b6963 100644
--- a/tests/language_2/language_2_dart2js.status
+++ b/tests/language_2/language_2_dart2js.status
@@ -651,6 +651,7 @@
 mixin_illegal_superclass_test/28: MissingCompileTimeError
 mixin_illegal_superclass_test/29: MissingCompileTimeError
 mixin_illegal_superclass_test/30: MissingCompileTimeError
+mixin_method_override_test/G5: Skip # Issue 34354
 mixin_of_mixin_test/none: CompileTimeError
 mixin_super_2_test/none: CompileTimeError
 mixin_super_test: CompileTimeError
diff --git a/tests/language_2/language_2_dartdevc.status b/tests/language_2/language_2_dartdevc.status
index 00a9055..440a3db 100644
--- a/tests/language_2/language_2_dartdevc.status
+++ b/tests/language_2/language_2_dartdevc.status
@@ -107,6 +107,7 @@
 mixin_forwarding_constructor4_test/01: CompileTimeError # See issue 15101
 mixin_forwarding_constructor4_test/02: CompileTimeError # See issue 15101
 mixin_forwarding_constructor4_test/03: CompileTimeError # See issue 15101
+mixin_method_override_test/01: MissingCompileTimeError # Issue 34235
 mixin_super_2_test/01: MissingCompileTimeError
 mixin_super_2_test/03: MissingCompileTimeError
 mixin_super_constructor_named_test/01: CompileTimeError # See issue 15101
diff --git a/tests/language_2/language_2_kernel.status b/tests/language_2/language_2_kernel.status
index c6a6d0e..1fb1238 100644
--- a/tests/language_2/language_2_kernel.status
+++ b/tests/language_2/language_2_kernel.status
@@ -155,6 +155,9 @@
 vm/type_cast_vm_test: RuntimeError
 web_int_literals_test/*: SkipByDesign # Test applies only to JavaScript targets
 
+[ $compiler == dartdevk ]
+mixin_method_override_test/G5: Skip # Issue 34354
+
 [ $compiler == dartkp ]
 covariant_subtyping_test: RuntimeError
 generic_methods_generic_function_result_test/01: MissingCompileTimeError
@@ -267,6 +270,32 @@
 mixin_invalid_bound_test/08: MissingCompileTimeError # Issue 33308
 mixin_invalid_bound_test/09: MissingCompileTimeError # Issue 33308
 mixin_invalid_bound_test/10: MissingCompileTimeError # Issue 33308
+mixin_method_override_test/C1: MissingCompileTimeError # Issue 34235
+mixin_method_override_test/C2: MissingCompileTimeError # Issue 34235
+mixin_method_override_test/C3: MissingCompileTimeError # Issue 34235
+mixin_method_override_test/C4: MissingCompileTimeError # Issue 34235
+mixin_method_override_test/C7: MissingCompileTimeError # Issue 34235
+mixin_method_override_test/C8: MissingCompileTimeError # Issue 34235
+mixin_method_override_test/G2: MissingCompileTimeError # Issue 34235
+mixin_method_override_test/G3: MissingCompileTimeError # Issue 34235
+mixin_method_override_test/G4: MissingCompileTimeError # Issue 34235
+mixin_method_override_test/G5: Crash # Issue 34354
+mixin_method_override_test/N10: MissingCompileTimeError # Issue 34235
+mixin_method_override_test/N11: MissingCompileTimeError # Issue 34235
+mixin_method_override_test/N12: MissingCompileTimeError # Issue 34235
+mixin_method_override_test/N13: MissingCompileTimeError # Issue 34235
+mixin_method_override_test/N14: MissingCompileTimeError # Issue 34235
+mixin_method_override_test/N3: MissingCompileTimeError # Issue 34235
+mixin_method_override_test/N4: MissingCompileTimeError # Issue 34235
+mixin_method_override_test/N5: MissingCompileTimeError # Issue 34235
+mixin_method_override_test/N6: MissingCompileTimeError # Issue 34235
+mixin_method_override_test/N9: MissingCompileTimeError # Issue 34235
+mixin_method_override_test/O10: MissingCompileTimeError # Issue 34235
+mixin_method_override_test/O13: MissingCompileTimeError # Issue 34235
+mixin_method_override_test/O14: MissingCompileTimeError # Issue 34235
+mixin_method_override_test/O5: MissingCompileTimeError # Issue 34235
+mixin_method_override_test/O6: MissingCompileTimeError # Issue 34235
+mixin_method_override_test/O9: MissingCompileTimeError # Issue 34235
 mixin_super_bound_test/01: MissingCompileTimeError # Issue 33308
 mixin_super_bound_test/02: MissingCompileTimeError # Issue 33308
 regress_22976_test/*: CompileTimeError # Issue 31935
@@ -2043,7 +2072,7 @@
 unresolved_top_level_method_test: MissingCompileTimeError
 unresolved_top_level_var_test: MissingCompileTimeError
 
-[ $fasta && ($compiler == dartkb || ($runtime != dart_precompiled && $runtime != vm)) ]
+[ $fasta && ($compiler == dartkb || $runtime != dart_precompiled && $runtime != vm) ]
 generic_function_type_as_type_argument_test/01: MissingCompileTimeError # Issue 30931
 generic_function_type_as_type_argument_test/02: MissingCompileTimeError # Issue 30931
 
diff --git a/tests/language_2/mixin_method_override_test.dart b/tests/language_2/mixin_method_override_test.dart
new file mode 100644
index 0000000..2ea1905
--- /dev/null
+++ b/tests/language_2/mixin_method_override_test.dart
@@ -0,0 +1,159 @@
+// Copyright (c) 2018, 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.
+
+// Signature conformance test.
+abstract class CII {
+  int id(int x);
+}
+
+class CSI {
+  String id(int x) => "$x";
+}
+
+class CIS {
+  int id(String x) => 0;
+}
+
+class CTT<T> {
+  T id(T x) => x;
+}
+
+// Wrong return type.
+abstract class C1 = CII with CIS; //# C1: compile-time error
+abstract class C2 extends CII with CIS {} //# C2: compile-time error
+// Wrong argument type.
+abstract class C3 = CII with CSI; //# C3: compile-time error
+abstract class C4 extends CII with CSI {} //# C4: compile-time error
+
+// Similar as the above but using an instantiated class instead.
+abstract class C5 = CII with CTT<int>;
+abstract class C6 extends CII with CTT<int> {}
+abstract class C7  = CII with CTT<String>; //# C7: compile-time error
+abstract class C8 extends CII with CTT<String> {} //# C8: compile-time error
+
+// Named parameters
+abstract class NIIx {
+  int id({int x}) => x;
+}
+
+class NIIxy {
+  int id({int x, int y}) => y;
+}
+
+class NIIy {
+  int id({int y}) => y;
+}
+
+class NII {
+  int id(int x) => x;
+}
+
+// It's OK to introduce more named parameters.
+abstract class N1 = NIIx with NIIxy;
+abstract class N2 extends NIIx with NIIxy {}
+// It's NOT OK to rename named parameters.
+abstract class N3 = NIIx with NIIy; //# N3: compile-time error
+abstract class N4 extends NIIx with NIIy {} //# N4: compile-time error
+// It's NOT OK to drop named parameters.
+abstract class N5 = NIIx with NII; //# N5: compile-time error
+abstract class N6 extends NIIx with NII {} //# N6: compile-time error
+
+class NBABxy<A, B> {
+  B id ({A x, B y}) => y;
+}
+
+class NTTy<T> {
+  T id({T y}) => y;
+}
+
+class NTTx<T> {
+  T id(T x) => x;
+}
+
+// Same as above but with generic classes.
+abstract class N7 = NIIx with NBABxy<int, int>;
+abstract class N8 extends NIIx with NBABxy<int, int> {}
+abstract class N9 = NIIx with NBABxy<String, int>; //# N9: compile-time error
+abstract class N10 extends NIIx with NBABxy<String, int> {} //# N10: compile-time error
+abstract class N11 = NIIx with NTTy<int>; //# N11: compile-time error
+abstract class N12 extends NIIx with NTTy<int> {} //# N12: compile-time error
+abstract class N13 = NIIx with NTTx<int>; //# N13: compile-time error
+abstract class N14 extends NIIx with NTTx<int> {} //# N14: compile-time error
+
+// Optional positional parameters
+abstract class OII {
+  int id([int x]) => x;
+}
+
+class OIII {
+  int id([int x, int y]) => y;
+}
+
+class OIIy {
+  int id([int y]) => y;
+}
+
+class PII {
+  int id(int x) => x;
+}
+
+// It's OK to introduce more optional parameters.
+abstract class O1 = OII with OIII;
+abstract class O2 extends OII with OIII {}
+// It's OK to rename optional parameters.
+abstract class O3 = OII with OIIy;
+abstract class O4 extends OII with OIIy {}
+// It's NOT OK to drop optional parameters.
+abstract class O5 = OII with PII; //# O5: compile-time error
+abstract class O6 extends OII with PII {} //# O6: compile-time error
+
+class OBAB<A, B> {
+  B id ([A x, B y]) => y;
+}
+
+class OTTy<T> {
+  T id([T y]) => y;
+}
+
+class PTT<T> {
+  T id(T x) => x;
+}
+
+// Same as above but with generic classes.
+abstract class O7 = OII with OBAB<int, int>;
+abstract class O8 extends OII with OBAB<int, int> {}
+abstract class O9 = OII with OBAB<String, int>; //# O9: compile-time error
+abstract class O10 extends OII with OBAB<String, int> {} //# O10: compile-time error
+abstract class O11 = OII with OTTy<int>;
+abstract class O12 extends OII with OTTy<int> {}
+abstract class O13 = OII with PTT<int>; //# O13: compile-time error
+abstract class O14 extends OII with PTT<int> {} //# O14: compile-time error
+
+// More tests with generic classes.
+abstract class GTTnum {
+  T id<T extends num>(x);
+}
+
+class MTTnum {
+  T id<T extends num>(x) => x;
+}
+
+class MTTint {
+  T id<T extends int>(x) => x;
+}
+
+class MTT {
+  T id<T>(x) => x;
+}
+
+class MTTnumR {
+  T id<T extends num, R>(x) => x;
+}
+class G1 = GTTnum with MTTnum;
+class G2 = GTTnum with MTTint; //# G2: compile-time error
+class G3 = GTTnum with MTT; //# G3: compile-time error
+class G4 = GTTnum with MTTnumR; //# G4: compile-time error
+class G5 = GTTnum with CII; //# G5: compile-time error
+
+void main() {}