diff --git a/tests/language_2/bug32372_test.dart b/tests/language_2/bug32372_test.dart index 3804958e5a2ec..2ce2b424a73cd 100644 --- a/tests/language_2/bug32372_test.dart +++ b/tests/language_2/bug32372_test.dart @@ -1,7 +1,6 @@ // 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. -// SharedOptions=--supermixin import "package:expect/expect.dart"; @@ -9,7 +8,7 @@ class A extends Object with B, C {} class B {} -class C extends B { +mixin C on B { get t => T; } diff --git a/tests/language_2/issue32353_2_test.dart b/tests/language_2/issue32353_2_test.dart index 6f0723bc8d0b3..c959089650673 100644 --- a/tests/language_2/issue32353_2_test.dart +++ b/tests/language_2/issue32353_2_test.dart @@ -1,7 +1,6 @@ // 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. -// SharedOptions=--supermixin // The following compile-time error is expected: // @@ -14,7 +13,7 @@ class A {} class B {} -class C extends B {} +mixin C on B {} class /*@compile-error=unspecified*/ D extends B with C {} diff --git a/tests/language_2/issue32353_test.dart b/tests/language_2/issue32353_test.dart index fbcc5d4988458..080d46d4b88b0 100644 --- a/tests/language_2/issue32353_test.dart +++ b/tests/language_2/issue32353_test.dart @@ -1,7 +1,6 @@ // 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. -// SharedOptions=--supermixin import "package:expect/expect.dart"; @@ -23,8 +22,8 @@ abstract class FileSystemEntity implements io_FileSystemEntity {} abstract class ForwardingFileSystemEntity implements FileSystemEntity {} -abstract class ForwardingDirectory - extends ForwardingFileSystemEntity implements Directory { +mixin ForwardingDirectory + on ForwardingFileSystemEntity implements Directory { get t => T; } diff --git a/tests/language_2/issue34404_flutter_test.dart b/tests/language_2/issue34404_flutter_test.dart index 4e1c7f7ebf38a..2e71697a48c01 100644 --- a/tests/language_2/issue34404_flutter_test.dart +++ b/tests/language_2/issue34404_flutter_test.dart @@ -1,7 +1,6 @@ // 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. -// SharedOptions=--supermixin // This test case is a reduction of some Flutter code. We wish to verify that // the class _DismissibleState doesn't have any type inference errors. @@ -21,13 +20,12 @@ abstract class Diagnosticable {} class Dismissible extends StatefulWidget {} -abstract class TickerProviderStateMixin - extends State implements TickerProvider {} +mixin TickerProviderStateMixin on State + implements TickerProvider {} abstract class TickerProvider {} -abstract class AutomaticKeepAliveClientMixin - extends State {} +mixin AutomaticKeepAliveClientMixin on State {} main() { new _DismissibleState(); diff --git a/tests/language_2/language_2_analyzer.status b/tests/language_2/language_2_analyzer.status index f189a963a5c2c..5d74bcc1f07f2 100644 --- a/tests/language_2/language_2_analyzer.status +++ b/tests/language_2/language_2_analyzer.status @@ -12,7 +12,6 @@ accessor_conflict_import_prefixed2_test: CompileTimeError # Issue 25626 accessor_conflict_import_prefixed_test: CompileTimeError # Issue 25626 accessor_conflict_import_test: CompileTimeError # Issue 25626 additional_interface_adds_optional_args_test: CompileTimeError # Issue #30568 -bug32372_test: Skip cascaded_forwarding_stubs_test: CompileTimeError # Issue 34329 config_import_corelib_test: CompileTimeError, StaticWarning, OK # failing-by-design: Will never pass, see Issue #34332 conflicting_generic_interfaces_hierarchy_loop_infinite_test: Skip # Issue #34333 (loops forever) @@ -70,40 +69,14 @@ issue31596_super_test/05: CompileTimeError # Issue #31596 issue31596_super_test/none: CompileTimeError # Issue #31596 issue31596_tearoff_test: CompileTimeError # Issue #31596 issue31596_test: CompileTimeError # Issue #31596 -issue32353_2_test: Skip -issue32353_test: Skip -issue34404_flutter_test: Skip issue34498_test: MissingCompileTimeError # Issue 34500 large_class_declaration_test: Slow, Pass malformed2_test: Pass, MissingCompileTimeError # Flaky: issue 31056. mixin_declaration/mixin_declaration_factory_test/02: Crash # Issue 34809 mixin_declaration/mixin_declaration_invalid_superinvocation_test/10: CompileTimeError # Issue 30552 mixin_method_override_test/01: MissingCompileTimeError -mixin_of_mixin_test: Skip -mixin_super_2_test: Skip -mixin_super_2_test/01: MissingCompileTimeError -mixin_super_2_test/03: MissingCompileTimeError -mixin_super_test: Skip -mixin_super_use_test: Skip -mixin_superclass_test: Skip -mixin_supertype_subclass2_test: Skip -mixin_supertype_subclass2_test/02: MissingStaticWarning # Issue 25614 -mixin_supertype_subclass2_test/05: MissingStaticWarning # Issue 25614 -mixin_supertype_subclass3_test: Skip -mixin_supertype_subclass3_test/02: MissingStaticWarning # Issue 25614 -mixin_supertype_subclass3_test/05: MissingStaticWarning # Issue 25614 -mixin_supertype_subclass4_test: Skip -mixin_supertype_subclass4_test/01: MissingStaticWarning # Issue 25614 -mixin_supertype_subclass4_test/02: MissingStaticWarning # Issue 25614 -mixin_supertype_subclass4_test/03: MissingStaticWarning # Issue 25614 -mixin_supertype_subclass4_test/04: MissingStaticWarning # Issue 25614 -mixin_supertype_subclass4_test/05: MissingStaticWarning # Issue 25614 -mixin_supertype_subclass_test: Skip -mixin_supertype_subclass_test/02: MissingCompileTimeError, MissingStaticWarning # failing-by-design, see Issue #34376 -mixin_supertype_subclass_test/05: MissingCompileTimeError, MissingStaticWarning # failing-by-design, see Issue #34376 -mixin_type_parameter_inference_error_test: Skip -mixin_type_parameter_inference_previous_mixin_test: Skip -mixin_type_parameter_inference_test: Skip +mixin_super_2_test: CompileTimeError +mixin_super_use_test: CompileTimeError mock_writable_final_private_field_test: CompileTimeError # failing-by-design, see Issue #34377 multiple_interface_inheritance_test: CompileTimeError # Issue 30552 nested_generic_closure_test: CompileTimeError # Issue #28515 diff --git a/tests/language_2/language_2_dart2js.status b/tests/language_2/language_2_dart2js.status index ca10f294dff96..4fd51d64373b5 100644 --- a/tests/language_2/language_2_dart2js.status +++ b/tests/language_2/language_2_dart2js.status @@ -10,7 +10,6 @@ bit_operations_test: RuntimeError, OK # non JS number semantics bit_operations_test/03: CompileTimeError, OK # Error if web int literal cannot be represented exactly, see http://dartbug.com/33351 bit_operations_test/04: CompileTimeError, OK # Error if web int literal cannot be represented exactly, see http://dartbug.com/33351 bit_operations_test/none: CompileTimeError, OK # Error if web int literal cannot be represented exactly, see http://dartbug.com/33351 -bug32372_test: CompileTimeError call_method_as_cast_test/06: RuntimeError call_method_implicit_tear_off_implements_function_test/05: RuntimeError call_method_implicit_tear_off_implements_function_test/06: RuntimeError @@ -47,29 +46,12 @@ int64_literal_test/17: RuntimeError, OK # Error if web int literal cannot be rep int64_literal_test/19: CompileTimeError, OK # Error if web int literal cannot be represented exactly, see http://dartbug.com/33351 int64_literal_test/none: RuntimeError, OK # Error if web int literal cannot be represented exactly, see http://dartbug.com/33351 issue23244_test: RuntimeError # Isolates - enum canonicalization - Issue 23244 -issue32353_test: CompileTimeError -issue34404_flutter_test: CompileTimeError # --supermixin not supported library_env_test/has_mirror_support: RuntimeError, OK library_env_test/has_no_html_support: RuntimeError, OK list_test: CompileTimeError, OK # Error if web int literal cannot be represented exactly, see http://dartbug.com/33351 mint_arithmetic_test: CompileTimeError, OK # Error if web int literal cannot be represented exactly, see http://dartbug.com/33351 mint_compares_test: CompileTimeError, OK # Error if web int literal cannot be represented exactly, see http://dartbug.com/33351 mint_identical_test: CompileTimeError, OK # Error if web int literal cannot be represented exactly, see http://dartbug.com/33351 -mixin_type_parameter_inference_error_test/none: CompileTimeError -mixin_type_parameter_inference_previous_mixin_test/01: CompileTimeError -mixin_type_parameter_inference_previous_mixin_test/02: CompileTimeError -mixin_type_parameter_inference_previous_mixin_test/05: CompileTimeError -mixin_type_parameter_inference_previous_mixin_test/none: CompileTimeError -mixin_type_parameter_inference_test/01: CompileTimeError -mixin_type_parameter_inference_test/02: CompileTimeError -mixin_type_parameter_inference_test/03: CompileTimeError -mixin_type_parameter_inference_test/08: CompileTimeError -mixin_type_parameter_inference_test/09: CompileTimeError -mixin_type_parameter_inference_test/10: CompileTimeError -mixin_type_parameter_inference_test/12: CompileTimeError -mixin_type_parameter_inference_test/13: CompileTimeError -mixin_type_parameter_inference_test/16: CompileTimeError -mixin_type_parameter_inference_test/none: CompileTimeError number_identity_test: CompileTimeError, OK # Error if web int literal cannot be represented exactly, see http://dartbug.com/33351 partial_instantiation_eager_bounds_check_test: RuntimeError # Issue #34295 partial_tearoff_instantiation_test/05: Pass # for the wrong reason. @@ -346,29 +328,6 @@ mixin_mixin7_test: RuntimeError mixin_mixin_bound2_test: RuntimeError mixin_mixin_bound_test: RuntimeError mixin_mixin_test: RuntimeError -mixin_of_mixin_test/none: CompileTimeError -mixin_super_2_test/none: CompileTimeError -mixin_super_test: CompileTimeError -mixin_super_use_test: CompileTimeError -mixin_superclass_test: CompileTimeError -mixin_supertype_subclass2_test/01: CompileTimeError -mixin_supertype_subclass2_test/02: CompileTimeError -mixin_supertype_subclass2_test/03: CompileTimeError -mixin_supertype_subclass2_test/04: CompileTimeError -mixin_supertype_subclass2_test/05: CompileTimeError -mixin_supertype_subclass2_test/none: CompileTimeError -mixin_supertype_subclass3_test/01: CompileTimeError -mixin_supertype_subclass3_test/02: CompileTimeError -mixin_supertype_subclass3_test/03: CompileTimeError -mixin_supertype_subclass3_test/04: CompileTimeError -mixin_supertype_subclass3_test/05: CompileTimeError -mixin_supertype_subclass3_test/none: CompileTimeError -mixin_supertype_subclass4_test/01: CompileTimeError -mixin_supertype_subclass4_test/02: CompileTimeError -mixin_supertype_subclass4_test/03: CompileTimeError -mixin_supertype_subclass4_test/04: CompileTimeError -mixin_supertype_subclass4_test/05: CompileTimeError -mixin_supertype_subclass4_test/none: CompileTimeError mixin_type_parameters_super_test: RuntimeError mock_writable_final_field_test: RuntimeError # Issue 30847 mock_writable_final_private_field_test: RuntimeError # Issue 17526, 30847 @@ -608,33 +567,6 @@ 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 -mixin_super_use_test: CompileTimeError -mixin_superclass_test: CompileTimeError -mixin_supertype_subclass2_test/01: CompileTimeError -mixin_supertype_subclass2_test/02: CompileTimeError -mixin_supertype_subclass2_test/03: CompileTimeError -mixin_supertype_subclass2_test/04: CompileTimeError -mixin_supertype_subclass2_test/05: CompileTimeError -mixin_supertype_subclass2_test/none: CompileTimeError -mixin_supertype_subclass3_test/01: CompileTimeError -mixin_supertype_subclass3_test/02: CompileTimeError -mixin_supertype_subclass3_test/03: CompileTimeError -mixin_supertype_subclass3_test/04: CompileTimeError -mixin_supertype_subclass3_test/05: CompileTimeError -mixin_supertype_subclass3_test/none: CompileTimeError -mixin_supertype_subclass4_test/01: CompileTimeError -mixin_supertype_subclass4_test/02: CompileTimeError -mixin_supertype_subclass4_test/03: CompileTimeError -mixin_supertype_subclass4_test/04: CompileTimeError -mixin_supertype_subclass4_test/05: CompileTimeError -mixin_supertype_subclass4_test/none: CompileTimeError -mixin_supertype_subclass_test/01: CompileTimeError -mixin_supertype_subclass_test/03: CompileTimeError -mixin_supertype_subclass_test/04: CompileTimeError -mixin_supertype_subclass_test/none: CompileTimeError mock_writable_final_field_test: RuntimeError # Issue 30847 mock_writable_final_private_field_test: RuntimeError # Issue 17526, 30847 modulo_test: RuntimeError # non JS number semantics diff --git a/tests/language_2/language_2_dartdevc.status b/tests/language_2/language_2_dartdevc.status index 85f559de6eb36..03dc93be87aeb 100644 --- a/tests/language_2/language_2_dartdevc.status +++ b/tests/language_2/language_2_dartdevc.status @@ -20,7 +20,6 @@ async_star_test/none: RuntimeError await_future_test: Pass, Timeout # Issue 29920 bit_operations_test: RuntimeError # No bigints on web. bug32372_test: RuntimeError -bug32372_test: Skip built_in_identifier_prefix_test: CompileTimeError built_in_identifier_type_annotation_test/dynamic-funarg: RuntimeError # Issue 28816 built_in_identifier_type_annotation_test/dynamic-funret: RuntimeError # Issue 28816 @@ -101,12 +100,9 @@ issue31596_super_test/05: CompileTimeError issue31596_super_test/none: CompileTimeError issue31596_tearoff_test: CompileTimeError issue31596_test: CompileTimeError -issue32353_2_test: Skip -issue32353_test: RuntimeError -issue32353_test: Skip +issue32353_test: CompileTimeError # Issue 34846 issue34404_flutter_modified_test: CompileTimeError # DDC doesn't support mixin inference issue34404_flutter_test: CompileTimeError # DDC doesn't support mixin inference -issue34404_flutter_test: Skip issue34498_test: MissingCompileTimeError # Issue 34500 issue34635_test: MissingCompileTimeError issue34636_test: MissingCompileTimeError @@ -154,28 +150,12 @@ mixin_declaration/mixin_declaration_inference_valid_C13_test: CompileTimeError # mixin_declaration/mixin_declaration_inference_valid_mixin_applications_test: CompileTimeError # https://github.com/dart-lang/sdk/issues/34164 mixin_declaration/mixin_declaration_invalid_superinvocation_test/10: CompileTimeError # Analyzer chooses wrong(?) super method. mixin_method_override_test/01: MissingCompileTimeError -mixin_of_mixin_test: Skip -mixin_super_2_test: Skip -mixin_super_2_test/01: MissingCompileTimeError -mixin_super_2_test/03: MissingCompileTimeError -mixin_super_test: RuntimeError -mixin_super_test: Skip -mixin_super_use_test: RuntimeError -mixin_super_use_test: Skip -mixin_superclass_test: Skip -mixin_supertype_subclass2_test: Skip -mixin_supertype_subclass3_test: Skip -mixin_supertype_subclass4_test: Skip -mixin_supertype_subclass_test: Skip -mixin_supertype_subclass_test/02: MissingCompileTimeError -mixin_supertype_subclass_test/05: MissingCompileTimeError -mixin_type_parameter_inference_error_test: Skip -mixin_type_parameter_inference_previous_mixin_test: Skip +mixin_super_2_test: CompileTimeError # Issue 34806 +mixin_super_use_test: CompileTimeError # Issue 34806 mixin_type_parameter_inference_previous_mixin_test/01: CompileTimeError mixin_type_parameter_inference_previous_mixin_test/02: CompileTimeError mixin_type_parameter_inference_previous_mixin_test/04: MissingCompileTimeError mixin_type_parameter_inference_previous_mixin_test/05: RuntimeError -mixin_type_parameter_inference_test: Skip mixin_type_parameter_inference_test/01: CompileTimeError mixin_type_parameter_inference_test/02: CompileTimeError mixin_type_parameter_inference_test/03: CompileTimeError @@ -344,12 +324,8 @@ mixin_illegal_superclass_test/27: MissingCompileTimeError mixin_illegal_superclass_test/28: MissingCompileTimeError mixin_illegal_superclass_test/29: MissingCompileTimeError mixin_illegal_superclass_test/30: MissingCompileTimeError -mixin_super_2_test/01: MissingCompileTimeError -mixin_super_2_test/03: MissingCompileTimeError -mixin_super_test: RuntimeError -mixin_super_use_test: RuntimeError -mixin_supertype_subclass_test/02: MissingCompileTimeError -mixin_supertype_subclass_test/05: MissingCompileTimeError +mixin_super_2_test: RuntimeError # Issue 34807 +mixin_super_use_test: RuntimeError # Issue 34808 mock_writable_final_private_field_test: RuntimeError multiline_newline_test/04: MissingCompileTimeError multiline_newline_test/04r: MissingCompileTimeError diff --git a/tests/language_2/language_2_kernel.status b/tests/language_2/language_2_kernel.status index 24b3ed8c73080..d715621a15600 100644 --- a/tests/language_2/language_2_kernel.status +++ b/tests/language_2/language_2_kernel.status @@ -296,12 +296,6 @@ super_call4_test/01: MissingCompileTimeError [ $compiler != dart2js && $compiler != dartdevk && $fasta ] const_native_factory_test: MissingCompileTimeError # Issue 29763 -[ $compiler != dart2js && $fasta ] -mixin_super_2_test/01: MissingCompileTimeError -mixin_super_2_test/03: MissingCompileTimeError -mixin_supertype_subclass_test/02: MissingCompileTimeError -mixin_supertype_subclass_test/05: MissingCompileTimeError - [ $compiler == dartk && $runtime == vm && !$checked && $strong ] assertion_initializer_const_error2_test/cc01: MissingCompileTimeError # Not reporting failed assert() at compile time. assertion_initializer_const_error2_test/cc02: MissingCompileTimeError # Not reporting failed assert() at compile time. diff --git a/tests/language_2/mixin_of_mixin_test.dart b/tests/language_2/mixin_of_mixin_test.dart deleted file mode 100644 index 9fb26d77b58d3..0000000000000 --- a/tests/language_2/mixin_of_mixin_test.dart +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright (c) 2016, 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=--supermixin - -// Validate the following text from section 12 ("Mixins") of the spec: -// -// "A mixin application of the form S with M; defines a class C ... -// ... C declares the same instance members as M ..." -// -// This means that if M is itself a mixin application, then things -// mixed into M are accessible through C. But if M simply *extends* a -// mixin application (e.g. because M is declared as `class M extends X -// with Y { ... }`) then things mixed into the mixin application that -// M extends are not accessible through C. - -class A { - a() => null; -} - -class B { - b() => null; -} - -class C { - c() => null; -} - -class D { - d() => null; -} - -// Note: by a slight abuse of syntax, `class M1 = A with B, C;` effectively -// means `class M1 = (A with B) with C;`, therefore M1 declares c(), but it -// merely inherits a() and b(). -class M1 = A with B, C; // declares c() - -class M2 extends M1 { - m2() => null; -} - -class M3 extends A with B, C { - m3() => null; -} - -class T1 = D with M1; // declares c() //# 01: compile-time error -class T2 = D with M2; // declares m2() //# 02: compile-time error -class T3 = D with M3; // declares m3() //# 03: compile-time error - -class T4 extends D with M1 {} // extends a class which declares c() //# 04: compile-time error - -class T5 extends D with M2 {} // extends a class which declares m2() //# 05: compile-time error - -class T6 extends D with M3 {} // extends a class which declares m3() //# 06: compile-time error - -main() { } diff --git a/tests/language_2/mixin_super_2_test.dart b/tests/language_2/mixin_super_2_test.dart index 2715148a8ecbb..aac47ff41f4ce 100644 --- a/tests/language_2/mixin_super_2_test.dart +++ b/tests/language_2/mixin_super_2_test.dart @@ -1,7 +1,6 @@ // Copyright (c) 2015, 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=--supermixin import "package:expect/expect.dart"; @@ -15,25 +14,28 @@ class R { toString() => 'R[' + super.toString() + ']'; } -class D extends R with B { //# 01: compile-time error - toString() => 'D<' + super.toString() + '>'; //# 01: continued -} //# 01: continued +class D extends R with B { + toString() => 'D<' + super.toString() + '>'; +} -class E extends D with B { //# 02: compile-time error - toString() => 'E{' + super.toString() + '}'; //# 02: continued -} //# 02: continued +class E extends D with B { + toString() => 'E{' + super.toString() + '}'; +} -class F = R with B, B; //# 03: compile-time error +class F = R with B, B; -class G extends F with B { //# 04: compile-time error - toString() => 'G{' + super.toString() + '}'; //# 04: continued -} //# 04: continued +class G extends F with B { + toString() => 'G{' + super.toString() + '}'; +} main() { check(object, String expected) { Expect.equals(expected, object.toString()); } - check(new B(), "B(Instance of 'B')"); - check(new R(), "R[Instance of 'R']"); + check(B(), "B(Instance of '$B')"); + check(R(), "R[Instance of '$R']"); + check(D(), "D"); + check(E(), "E{B(D)}"); + check(G(), "G{B(B(B(R[Instance of '$G'])))}"); } diff --git a/tests/language_2/mixin_super_test.dart b/tests/language_2/mixin_super_test.dart index 1f4c2b017005f..75ad654f7c292 100644 --- a/tests/language_2/mixin_super_test.dart +++ b/tests/language_2/mixin_super_test.dart @@ -1,7 +1,6 @@ // Copyright (c) 2015, 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=--supermixin import "package:expect/expect.dart"; @@ -11,7 +10,7 @@ class MS { } } -class M extends MS> { +mixin M on MS> { foo() { return super.foo() + "M<$T>.foo\n"; } @@ -23,33 +22,33 @@ class NS { } } -class N extends NS> { +mixin N on NS> { foo() { return super.foo() + "N<$T>.foo\n"; } } -class S { +class S implements MS>, NS> { foo() { - return "S<$T>.foo\n"; + return "S<$T,$V,$W>.foo\n"; } } -class SM = S> with M>; +class SM = S with M; -class MNA1 extends S> with M>, N { +class MNA1 extends S with M, N { foo() { return super.foo() + "MNA1<$U, $V, $W>.foo\n"; } } -class MNA2 extends SM with N { +class MNA2 extends SM with N { foo() { return super.foo() + "MNA2<$U, $V, $W>.foo\n"; } } -class MNA3 extends S> with SM, N { +class MNA3 extends S with M, N { foo() { return super.foo() + "MNA3<$U, $V, $W>.foo\n"; } @@ -57,29 +56,25 @@ class MNA3 extends S> with SM, N { main() { Expect.equals( - "MS>.foo\n" - "M.foo\n", - new M().foo()); + "S.foo\n" + "M.foo\n", + SM().foo()); Expect.equals( - "S>.foo\n" - "M>.foo\n", - new SM().foo()); - Expect.equals( - "S>.foo\n" - "M>.foo\n" + "S.foo\n" + "M.foo\n" "N.foo\n" "MNA1.foo\n", - new MNA1().foo()); + MNA1().foo()); Expect.equals( - "S>.foo\n" - "M>.foo\n" + "S.foo\n" + "M.foo\n" "N.foo\n" "MNA2.foo\n", - new MNA2().foo()); + MNA2().foo()); Expect.equals( - "S>.foo\n" - "M>.foo\n" + "S.foo\n" + "M.foo\n" "N.foo\n" "MNA3.foo\n", - new MNA3().foo()); + MNA3().foo()); } diff --git a/tests/language_2/mixin_super_use_test.dart b/tests/language_2/mixin_super_use_test.dart index 0076bd953245f..f0fc152454538 100644 --- a/tests/language_2/mixin_super_use_test.dart +++ b/tests/language_2/mixin_super_use_test.dart @@ -1,7 +1,6 @@ // Copyright (c) 2013, 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=--supermixin import "package:expect/expect.dart"; diff --git a/tests/language_2/mixin_superclass_test.dart b/tests/language_2/mixin_superclass_test.dart index 162d6ee934887..7e2c6d175e432 100644 --- a/tests/language_2/mixin_superclass_test.dart +++ b/tests/language_2/mixin_superclass_test.dart @@ -1,7 +1,6 @@ // Copyright (c) 2013, 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=--supermixin class S0 {} @@ -13,135 +12,111 @@ class M0 {} class M1 extends Object {} -class M2 extends M0 {} +mixin M2 on M0 {} class C00 = S0 with M0; class C01 = S0 with M1; -class C02 = S0 with M2; +class C02 = S0 with M2; //# C02: compile-time error class C03 = S0 with M0, M1; class C04 = S0 with M0, M2; -class C05 = S0 with M2, M0; -class C06 = S0 with M1, M2; -class C07 = S0 with M2, M1; +class C05 = S0 with M2, M0; //# C05: compile-time error +class C06 = S0 with M1, M2; //# C06: compile-time error +class C07 = S0 with M2, M1; //# C07: compile-time error class C10 = S1 with M0; class C11 = S1 with M1; -class C12 = S1 with M2; +class C12 = S1 with M2; //# C12: compile-time error class C13 = S1 with M0, M1; class C14 = S1 with M0, M2; -class C15 = S1 with M2, M0; -class C16 = S1 with M1, M2; -class C17 = S1 with M2, M1; +class C15 = S1 with M2, M0; //# C15: compile-time error +class C16 = S1 with M1, M2; //# C16: compile-time error +class C17 = S1 with M2, M1; //# C17: compile-time error class C20 = S2 with M0; class C21 = S2 with M1; -class C22 = S2 with M2; +class C22 = S2 with M2; //# C22: compile-time error class C23 = S2 with M0, M1; class C24 = S2 with M0, M2; -class C25 = S2 with M2, M0; -class C26 = S2 with M1, M2; -class C27 = S2 with M2, M1; +class C25 = S2 with M2, M0; //# C25: compile-time error +class C26 = S2 with M1, M2; //# C26: compile-time error +class C27 = S2 with M2, M1; //# C27: compile-time error class D00 extends S0 with M0 {} class D01 extends S0 with M1 {} -class D02 extends S0 with M2 {} +class D02 extends S0 with M2 {} //# D02: compile-time error class D03 extends S0 with M0, M1 {} class D04 extends S0 with M0, M2 {} -class D05 extends S0 with M2, M0 {} +class D05 extends S0 with M2, M0 {} //# D05: compile-time error -class D06 extends S0 with M1, M2 {} +class D06 extends S0 with M1, M2 {} //# D06: compile-time error -class D07 extends S0 with M2, M1 {} +class D07 extends S0 with M2, M1 {} //# D07: compile-time error class D10 extends S1 with M0 {} class D11 extends S1 with M1 {} -class D12 extends S1 with M2 {} +class D12 extends S1 with M2 {} //# D12: compile-time error class D13 extends S1 with M0, M1 {} class D14 extends S1 with M0, M2 {} -class D15 extends S1 with M2, M0 {} +class D15 extends S1 with M2, M0 {} //# D15: compile-time error -class D16 extends S1 with M1, M2 {} +class D16 extends S1 with M1, M2 {} //# D16: compile-time error -class D17 extends S1 with M2, M1 {} +class D17 extends S1 with M2, M1 {} //# D17: compile-time error class D20 extends S2 with M0 {} class D21 extends S2 with M1 {} -class D22 extends S2 with M2 {} +class D22 extends S2 with M2 {} //# D22: compile-time error class D23 extends S2 with M0, M1 {} class D24 extends S2 with M0, M2 {} -class D25 extends S2 with M2, M0 {} +class D25 extends S2 with M2, M0 {} //# D25: compile-time error -class D26 extends S2 with M1, M2 {} +class D26 extends S2 with M1, M2 {} //# D26: compile-time error -class D27 extends S2 with M2, M1 {} +class D27 extends S2 with M2, M1 {} //# D27: compile-time error main() { new C00(); new C01(); - new C02(); new C03(); new C04(); - new C05(); - new C06(); - new C07(); new C10(); new C11(); - new C12(); new C13(); new C14(); - new C15(); - new C16(); - new C17(); new C20(); new C21(); - new C22(); new C23(); new C24(); - new C25(); - new C26(); - new C27(); new D00(); new D01(); - new D02(); new D03(); new D04(); - new D05(); - new D06(); - new D07(); new D10(); new D11(); - new D12(); new D13(); new D14(); - new D15(); - new D16(); - new D17(); new D20(); new D21(); - new D22(); new D23(); new D24(); - new D25(); - new D26(); - new D27(); } diff --git a/tests/language_2/mixin_supertype_subclass2_test.dart b/tests/language_2/mixin_supertype_subclass2_test.dart index 71d1c38624fea..0bafafc296d85 100644 --- a/tests/language_2/mixin_supertype_subclass2_test.dart +++ b/tests/language_2/mixin_supertype_subclass2_test.dart @@ -1,15 +1,6 @@ // Copyright (c) 2016, 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=--supermixin - -// Validate the following test from section 12 ("Mixins") of the spec: -// -// "Let M_A be a mixin derived from a class M with direct superclass -// S_static. -// -// Let A be an application of M_A. It is a static warning if the -// superclass of A is not a subtype of S_static." class B {} @@ -21,16 +12,17 @@ class E extends B with C implements D {} class F extends E {} -class A extends E with M {} - -class M - extends B //# 01: ok - extends C //# 02: static type warning - extends D //# 03: ok - extends E //# 04: ok - extends F //# 05: static type warning +// M is mixed onto E which implements B, C and D. +mixin M // + on B //# 01: ok + on C //# 02: ok + on D //# 03: ok + on E //# 04: ok + on F //# 05: compile-time error {} +class A extends E with M {} + main() { new A(); } diff --git a/tests/language_2/mixin_supertype_subclass3_test.dart b/tests/language_2/mixin_supertype_subclass3_test.dart deleted file mode 100644 index c1893fe2addcc..0000000000000 --- a/tests/language_2/mixin_supertype_subclass3_test.dart +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (c) 2016, 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=--supermixin - -// Validate the following test from section 12 ("Mixins") of the spec: -// -// "Let M_A be a mixin derived from a class M with direct superclass -// S_static. -// -// Let A be an application of M_A. It is a static warning if the -// superclass of A is not a subtype of S_static." - -// In this test, M is declared as `class M = S_static with G;`. - -class B {} - -class C {} - -class D {} - -class E extends B with C implements D {} - -class F extends E {} - -class A - = E with M; class M = B with G; class G //# 01: ok - = E with M; class M = C with G; class G //# 02: static type warning - = E with M; class M = D with G; class G //# 03: ok - = E with M; class M = E with G; class G //# 04: ok - = E with M; class M = F with G; class G //# 05: static type warning -{} - -main() { - new A(); -} diff --git a/tests/language_2/mixin_supertype_subclass4_test.dart b/tests/language_2/mixin_supertype_subclass4_test.dart deleted file mode 100644 index 82770d3925ac0..0000000000000 --- a/tests/language_2/mixin_supertype_subclass4_test.dart +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) 2016, 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=--supermixin - -// Validate the following test from section 12 ("Mixins") of the spec: -// -// "Let M_A be a mixin derived from a class M with direct superclass -// S_static. -// -// Let A be an application of M_A. It is a static warning if the -// superclass of A is not a subtype of S_static." - -// In this test, M is declared as `class M extends ... with G {}`, so -// `S_static` is the unnamed mixin application `... with G`. Since this -// unnamed mixin application can't be derived from, all the cases should yield -// a warning. - -class B {} - -class C {} - -class D {} - -class E extends B with C implements D {} - -class F extends E {} - -class G {} - -class A = E with M; - -class M - extends B with G //# 01: static type warning - extends C with G //# 02: static type warning - extends D with G //# 03: static type warning - extends E with G //# 04: static type warning - extends F with G //# 05: static type warning -{} - -main() { - new A(); -} diff --git a/tests/language_2/mixin_supertype_subclass_test.dart b/tests/language_2/mixin_supertype_subclass_test.dart index 9afa29c721a78..1e2c7cac01446 100644 --- a/tests/language_2/mixin_supertype_subclass_test.dart +++ b/tests/language_2/mixin_supertype_subclass_test.dart @@ -1,15 +1,6 @@ // Copyright (c) 2016, 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=--supermixin - -// Validate the following test from section 12 ("Mixins") of the spec: -// -// "Let M_A be a mixin derived from a class M with direct superclass -// S_static. -// -// Let A be an application of M_A. It is a static warning if the -// superclass of A is not a subtype of S_static." class B {} @@ -21,16 +12,17 @@ class E extends B with C implements D {} class F extends E {} -class A = E with M; - -class M - extends B //# 01: ok - extends C //# 02: compile-time error - extends D //# 03: ok - extends E //# 04: ok - extends F //# 05: compile-time error +// M is mixed onto E which implements B, C and D. +mixin M // + on B //# 01: ok + on C //# 02: ok + on D //# 03: ok + on E //# 04: ok + on F //# 05: compile-time error {} +class A = E with M; + main() { new A(); } diff --git a/tests/language_2/mixin_type_parameter_inference_error_test.dart b/tests/language_2/mixin_type_parameter_inference_error_test.dart index fe1914e0b5c39..c720e4949b73c 100644 --- a/tests/language_2/mixin_type_parameter_inference_error_test.dart +++ b/tests/language_2/mixin_type_parameter_inference_error_test.dart @@ -1,22 +1,24 @@ // 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. -// SharedOptions=--supermixin abstract class A {} class B {} -class M extends A {} +mixin M on A {} // No matching class from which to infer the type parameter of M class C extends Object with M {} //# 01: compile-time error class C = Object with M; //# 02: compile-time error -// Satisfying the constraint in the "implements" clause is not sufficient +// Satisfying the constraint with an "implements" clause is not sufficient class C extends Object with M implements A {} //# 03: compile-time error class C = Object with M implements A; //# 04: compile-time error +// Mixin works when used correctly. +class D = A with M; + main() {} diff --git a/tests/language_2/mixin_type_parameter_inference_previous_mixin_test.dart b/tests/language_2/mixin_type_parameter_inference_previous_mixin_test.dart index 01ac84697830c..a3d9ce53a1d08 100644 --- a/tests/language_2/mixin_type_parameter_inference_previous_mixin_test.dart +++ b/tests/language_2/mixin_type_parameter_inference_previous_mixin_test.dart @@ -1,7 +1,6 @@ // 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. -// SharedOptions=--supermixin import "package:expect/expect.dart"; @@ -15,7 +14,7 @@ class B {} abstract class M1 implements A {} -class M2 extends A { +mixin M2 on A { T f(T x) => x; T g(T x) => x; Type h() => T; diff --git a/tests/language_2/mixin_type_parameter_inference_test.dart b/tests/language_2/mixin_type_parameter_inference_test.dart index 1c2400cf8ec23..8d5f336a0af21 100644 --- a/tests/language_2/mixin_type_parameter_inference_test.dart +++ b/tests/language_2/mixin_type_parameter_inference_test.dart @@ -1,7 +1,6 @@ // 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. -// SharedOptions=--supermixin import "package:expect/expect.dart"; @@ -13,7 +12,7 @@ abstract class A { class B {} -class M1 extends A { +mixin M1 on A { T f(T x) => x; T g(T x) => x; Type h() => T;