mirror of
https://github.com/dart-lang/sdk
synced 2024-11-05 18:22:09 +00:00
Update old mixin tests. Remove the --super-mixins flag from the tests.
Bug: http://dartbug.com/34781 Change-Id: Ib07e1927e7de35ff0c48514b9e89da65a5f192dd Reviewed-on: https://dart-review.googlesource.com/c/79700 Commit-Queue: Lasse R.H. Nielsen <lrn@google.com> Reviewed-by: Leaf Petersen <leafp@google.com>
This commit is contained in:
parent
a394e4f492
commit
03765ed6ec
20 changed files with 99 additions and 409 deletions
|
@ -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<String>, C {}
|
|||
|
||||
class B<T> {}
|
||||
|
||||
class C<T> extends B<T> {
|
||||
mixin C<T> on B<T> {
|
||||
get t => T;
|
||||
}
|
||||
|
||||
|
|
|
@ -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<X, Y> {}
|
||||
|
||||
class C<X> extends B<X, A> {}
|
||||
mixin C<X> on B<X, A> {}
|
||||
|
||||
class /*@compile-error=unspecified*/ D<X, Y> extends B<X, Y> with C {}
|
||||
|
||||
|
|
|
@ -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<T extends FileSystemEntity,
|
||||
D extends io_FileSystemEntity> implements FileSystemEntity {}
|
||||
|
||||
abstract class ForwardingDirectory<T extends Directory>
|
||||
extends ForwardingFileSystemEntity<T, io_Directory> implements Directory {
|
||||
mixin ForwardingDirectory<T extends Directory>
|
||||
on ForwardingFileSystemEntity<T, io_Directory> implements Directory {
|
||||
get t => T;
|
||||
}
|
||||
|
||||
|
|
|
@ -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<T extends StatefulWidget>
|
||||
extends State<T> implements TickerProvider {}
|
||||
mixin TickerProviderStateMixin<T extends StatefulWidget> on State<T>
|
||||
implements TickerProvider {}
|
||||
|
||||
abstract class TickerProvider {}
|
||||
|
||||
abstract class AutomaticKeepAliveClientMixin<T extends StatefulWidget>
|
||||
extends State<T> {}
|
||||
mixin AutomaticKeepAliveClientMixin<T extends StatefulWidget> on State<T> {}
|
||||
|
||||
main() {
|
||||
new _DismissibleState();
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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() { }
|
|
@ -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<B(R[Instance of '$D'])>");
|
||||
check(E(), "E{B(D<B(R[Instance of '$E'])>)}");
|
||||
check(G(), "G{B(B(B(R[Instance of '$G'])))}");
|
||||
}
|
||||
|
|
|
@ -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<T> {
|
|||
}
|
||||
}
|
||||
|
||||
class M<T> extends MS<List<T>> {
|
||||
mixin M<T> on MS<List<T>> {
|
||||
foo() {
|
||||
return super.foo() + "M<$T>.foo\n";
|
||||
}
|
||||
|
@ -23,33 +22,33 @@ class NS<T> {
|
|||
}
|
||||
}
|
||||
|
||||
class N<T> extends NS<List<T>> {
|
||||
mixin N<T> on NS<List<T>> {
|
||||
foo() {
|
||||
return super.foo() + "N<$T>.foo\n";
|
||||
}
|
||||
}
|
||||
|
||||
class S<T> {
|
||||
class S<T, V, W> implements MS<List<V>>, NS<List<W>> {
|
||||
foo() {
|
||||
return "S<$T>.foo\n";
|
||||
return "S<$T,$V,$W>.foo\n";
|
||||
}
|
||||
}
|
||||
|
||||
class SM<U, V> = S<List<U>> with M<Map<U, V>>;
|
||||
class SM<U, V, W> = S<U, V, W> with M<V>;
|
||||
|
||||
class MNA1<U, V, W> extends S<List<U>> with M<Map<U, V>>, N<W> {
|
||||
class MNA1<U, V, W> extends S<U, V, W> with M<V>, N<W> {
|
||||
foo() {
|
||||
return super.foo() + "MNA1<$U, $V, $W>.foo\n";
|
||||
}
|
||||
}
|
||||
|
||||
class MNA2<U, V, W> extends SM<U, V> with N<W> {
|
||||
class MNA2<U, V, W> extends SM<U, V, W> with N<W> {
|
||||
foo() {
|
||||
return super.foo() + "MNA2<$U, $V, $W>.foo\n";
|
||||
}
|
||||
}
|
||||
|
||||
class MNA3<U, V, W> extends S<List<U>> with SM<U, V>, N<W> {
|
||||
class MNA3<U, V, W> extends S<U, V, W> with M<V>, N<W> {
|
||||
foo() {
|
||||
return super.foo() + "MNA3<$U, $V, $W>.foo\n";
|
||||
}
|
||||
|
@ -57,29 +56,25 @@ class MNA3<U, V, W> extends S<List<U>> with SM<U, V>, N<W> {
|
|||
|
||||
main() {
|
||||
Expect.equals(
|
||||
"MS<List<double>>.foo\n"
|
||||
"M<double>.foo\n",
|
||||
new M<double>().foo());
|
||||
"S<int,String,bool>.foo\n"
|
||||
"M<String>.foo\n",
|
||||
SM<int, String, bool>().foo());
|
||||
Expect.equals(
|
||||
"S<List<int>>.foo\n"
|
||||
"M<Map<int, String>>.foo\n",
|
||||
new SM<int, String>().foo());
|
||||
Expect.equals(
|
||||
"S<List<int>>.foo\n"
|
||||
"M<Map<int, String>>.foo\n"
|
||||
"S<int,String,bool>.foo\n"
|
||||
"M<String>.foo\n"
|
||||
"N<bool>.foo\n"
|
||||
"MNA1<int, String, bool>.foo\n",
|
||||
new MNA1<int, String, bool>().foo());
|
||||
MNA1<int, String, bool>().foo());
|
||||
Expect.equals(
|
||||
"S<List<int>>.foo\n"
|
||||
"M<Map<int, String>>.foo\n"
|
||||
"S<int,String,bool>.foo\n"
|
||||
"M<String>.foo\n"
|
||||
"N<bool>.foo\n"
|
||||
"MNA2<int, String, bool>.foo\n",
|
||||
new MNA2<int, String, bool>().foo());
|
||||
MNA2<int, String, bool>().foo());
|
||||
Expect.equals(
|
||||
"S<List<int>>.foo\n"
|
||||
"M<Map<int, String>>.foo\n"
|
||||
"S<int,String,bool>.foo\n"
|
||||
"M<String>.foo\n"
|
||||
"N<bool>.foo\n"
|
||||
"MNA3<int, String, bool>.foo\n",
|
||||
new MNA3<int, String, bool>().foo());
|
||||
MNA3<int, String, bool>().foo());
|
||||
}
|
||||
|
|
|
@ -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";
|
||||
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
|
|
@ -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();
|
||||
}
|
|
@ -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();
|
||||
}
|
|
@ -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();
|
||||
}
|
||||
|
|
|
@ -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<T> {}
|
||||
|
||||
class B {}
|
||||
|
||||
class M<T> extends A<T> {}
|
||||
mixin M<T> on A<T> {}
|
||||
|
||||
// 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<B> {} //# 03: compile-time error
|
||||
|
||||
class C = Object with M implements A<B>; //# 04: compile-time error
|
||||
|
||||
// Mixin works when used correctly.
|
||||
class D = A<B> with M<B>;
|
||||
|
||||
main() {}
|
||||
|
|
|
@ -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<B> {}
|
||||
|
||||
class M2<T> extends A<T> {
|
||||
mixin M2<T> on A<T> {
|
||||
T f(T x) => x;
|
||||
T g(T x) => x;
|
||||
Type h() => T;
|
||||
|
|
|
@ -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<T> {
|
|||
|
||||
class B {}
|
||||
|
||||
class M1<T> extends A<T> {
|
||||
mixin M1<T> on A<T> {
|
||||
T f(T x) => x;
|
||||
T g(T x) => x;
|
||||
Type h() => T;
|
||||
|
|
Loading…
Reference in a new issue