Attention is currently required from: Leaf Petersen.
Kallen Tu would like Leaf Petersen to review this change.
[tests] Remove interface mixin, final mixin, and sealed mixin from language tests.
Change-Id: I8d92758c3a43ed0eff2e0c953ae8a87e65a3a920
---
M tests/language/class_modifiers/base/base_class_base_subtype_test.dart
M tests/language/class_modifiers/base/base_class_subtype_base_final_or_sealed_test.dart
M tests/language/class_modifiers/final/final_class_final_subtype_test.dart
M tests/language/class_modifiers/final/final_class_inside_not_base_final_sealed_error_test.dart
M tests/language/class_modifiers/final/final_class_subtype_base_final_or_sealed_test.dart
D tests/language/class_modifiers/final/final_mixin_implement_lib.dart
D tests/language/class_modifiers/final/final_mixin_implement_outside_error_test.dart
D tests/language/class_modifiers/final/final_mixin_implement_test.dart
D tests/language/class_modifiers/final/final_mixin_typedef_with_lib.dart
D tests/language/class_modifiers/final/final_mixin_typedef_with_outside_error_test.dart
D tests/language/class_modifiers/final/final_mixin_typedef_with_test.dart
D tests/language/class_modifiers/final/final_mixin_with_lib.dart
D tests/language/class_modifiers/final/final_mixin_with_outside_error_test.dart
D tests/language/class_modifiers/final/final_mixin_with_test.dart
M tests/language/class_modifiers/interface/interface_class_interface_subtype_test.dart
M tests/language/class_modifiers/interface/interface_class_mixin_on_lib.dart
M tests/language/class_modifiers/interface/interface_class_mixin_on_test.dart
D tests/language/class_modifiers/interface/interface_mixin_implement_lib.dart
D tests/language/class_modifiers/interface/interface_mixin_implement_outside_test.dart
D tests/language/class_modifiers/interface/interface_mixin_typedef_with_lib.dart
D tests/language/class_modifiers/interface/interface_mixin_typedef_with_outside_error_test.dart
D tests/language/class_modifiers/interface/interface_mixin_typedef_with_test.dart
D tests/language/class_modifiers/interface/interface_mixin_with_lib.dart
D tests/language/class_modifiers/interface/interface_mixin_with_outside_error_test.dart
D tests/language/class_modifiers/interface/interface_mixin_with_test.dart
M tests/language/class_modifiers/legacy/final_class_syntax_disabled_error_test.dart
M tests/language/class_modifiers/legacy/interface_class_syntax_disabled_error_test.dart
M tests/language/sealed_class/sealed_class_as_mixin_error_test.dart
M tests/language/sealed_class/sealed_class_as_mixin_lib.dart
M tests/language/sealed_class/sealed_class_construct_error_test.dart
M tests/language/sealed_class/sealed_class_sealed_subtype_test.dart
M tests/language/sealed_class/sealed_class_syntax_disabled_error_test.dart
D tests/language/sealed_class/sealed_mixin_typedef_error_test.dart
D tests/language/sealed_class/sealed_mixin_typedef_lib.dart
D tests/language/sealed_class/sealed_mixin_typedef_test.dart
D tests/language/sealed_class/sealed_mixin_with_error_test.dart
D tests/language/sealed_class/sealed_mixin_with_lib.dart
D tests/language/sealed_class/sealed_mixin_with_test.dart
38 files changed, 46 insertions(+), 662 deletions(-)
diff --git a/tests/language/class_modifiers/base/base_class_base_subtype_test.dart b/tests/language/class_modifiers/base/base_class_base_subtype_test.dart
index 2b1cc02..bd64d2a 100644
--- a/tests/language/class_modifiers/base/base_class_base_subtype_test.dart
+++ b/tests/language/class_modifiers/base/base_class_base_subtype_test.dart
@@ -11,7 +11,9 @@
base class BaseClass {
int foo = 0;
}
+
base class A extends BaseClass {}
+
base class B implements BaseClass {
int foo = 1;
}
@@ -19,13 +21,18 @@
base mixin BaseMixin {
int foo = 0;
}
+
base class AMixin with BaseMixin {}
+
base class BMixin = Object with BaseMixin;
// Used for trivial runtime tests of the base subtypes.
base class AConcrete extends A {}
+
base class BConcrete extends B {}
+
base class AMixinConcrete extends AMixin {}
+
base class BMixinConcrete extends BMixin {}
main() {
diff --git a/tests/language/class_modifiers/base/base_class_subtype_base_final_or_sealed_test.dart b/tests/language/class_modifiers/base/base_class_subtype_base_final_or_sealed_test.dart
index 20afd1a..04ba58f 100644
--- a/tests/language/class_modifiers/base/base_class_subtype_base_final_or_sealed_test.dart
+++ b/tests/language/class_modifiers/base/base_class_subtype_base_final_or_sealed_test.dart
@@ -12,49 +12,57 @@
base class BaseClass {
int foo = 0;
}
+
base mixin BaseMixin {
int foo = 0;
}
base class BaseExtends extends BaseClass {}
+
final class FinalExtends extends BaseClass {}
+
sealed class SealedExtends extends BaseClass {}
+
base class SealedExtendsImpl extends SealedExtends {}
base class BaseImplements implements BaseClass {
int foo = 0;
}
+
final class FinalImplements implements BaseClass {
int foo = 0;
}
+
sealed class SealedImplements implements BaseClass {
int foo = 0;
}
+
base class SealedImplementsImpl extends SealedImplements {}
base mixin BaseMixinImplements implements BaseMixin {}
-final mixin FinalMixinImplements implements BaseMixin {}
-sealed mixin SealedMixinImplements implements BaseMixin {}
-base class ImplementsImpl implements BaseMixinImplements, FinalMixinImplements, SealedMixinImplements {
+base class ImplementsImpl implements BaseMixinImplements {
int foo = 0;
}
base class BaseWith with BaseMixin {}
+
final class FinalWith with BaseMixin {}
+
sealed class SealedWith with BaseMixin {}
+
base class SealedWithImpl extends SealedWith {}
base mixin BaseOn on BaseClass {}
-final mixin FinalOn on BaseClass {}
-sealed mixin SealedOn on BaseClass {}
-base class OnImpl implements BaseOn, FinalOn, SealedOn {
+base class OnImpl implements BaseOn {
int foo = 0;
}
base mixin MixinForEnum {}
+
enum EnumWith with MixinForEnum { x }
+
enum EnumImplements implements MixinForEnum { x }
main() {
diff --git a/tests/language/class_modifiers/final/final_class_final_subtype_test.dart b/tests/language/class_modifiers/final/final_class_final_subtype_test.dart
index c6cec1d..88c54fe 100644
--- a/tests/language/class_modifiers/final/final_class_final_subtype_test.dart
+++ b/tests/language/class_modifiers/final/final_class_final_subtype_test.dart
@@ -11,31 +11,19 @@
final class FinalClass {
int foo = 0;
}
+
final class A extends FinalClass {}
+
final class B implements FinalClass {
int foo = 1;
}
-final mixin FinalMixin {
- int foo = 0;
-}
-final class C implements FinalMixin {
- int foo = 1;
-}
-final class AMixin with FinalMixin {}
-final class BMixin = Object with FinalMixin;
-
// Used for trivial runtime tests of the final subtypes.
final class AConcrete extends A {}
+
final class BConcrete extends B {}
-final class CConcrete extends C {}
-final class AMixinConcrete extends AMixin {}
-final class BMixinConcrete extends BMixin {}
main() {
Expect.equals(0, AConcrete().foo);
Expect.equals(1, BConcrete().foo);
- Expect.equals(1, CConcrete().foo);
- Expect.equals(0, AMixinConcrete().foo);
- Expect.equals(0, BMixinConcrete().foo);
-}
\ No newline at end of file
+}
diff --git a/tests/language/class_modifiers/final/final_class_inside_not_base_final_sealed_error_test.dart b/tests/language/class_modifiers/final/final_class_inside_not_base_final_sealed_error_test.dart
index 4aa63b9..63d8f58 100644
--- a/tests/language/class_modifiers/final/final_class_inside_not_base_final_sealed_error_test.dart
+++ b/tests/language/class_modifiers/final/final_class_inside_not_base_final_sealed_error_test.dart
@@ -9,16 +9,12 @@
final class FinalClass {}
-final mixin FinalMixin {}
-
base class BaseClass extends FinalClass {}
sealed class SubtypeOfFinal extends FinalClass {}
class RegularClass {}
-final mixin FinalMixin2 {}
-
class Extends extends FinalClass {}
// ^^^^^^^
// [analyzer] COMPILE_TIME_ERROR.SUBTYPE_OF_BASE_OR_FINAL_IS_NOT_BASE_FINAL_OR_SEALED
@@ -29,21 +25,6 @@
// [analyzer] COMPILE_TIME_ERROR.SUBTYPE_OF_BASE_OR_FINAL_IS_NOT_BASE_FINAL_OR_SEALED
// [cfe] The type 'Implements' must be 'base', 'final' or 'sealed' because the supertype 'FinalClass' is 'final'.
-mixin MixinImplements implements FinalMixin {}
-// ^^^^^^^^^^^^^^^
-// [analyzer] COMPILE_TIME_ERROR.SUBTYPE_OF_BASE_OR_FINAL_IS_NOT_BASE_FINAL_OR_SEALED
-// [cfe] The type 'MixinImplements' must be 'base', 'final' or 'sealed' because the supertype 'FinalMixin' is 'final'.
-
-class With with FinalMixin {}
-// ^^^^
-// [analyzer] COMPILE_TIME_ERROR.SUBTYPE_OF_BASE_OR_FINAL_IS_NOT_BASE_FINAL_OR_SEALED
-// [cfe] The type 'With' must be 'base', 'final' or 'sealed' because the supertype 'FinalMixin' is 'final'.
-
-class With2 with FinalMixin, FinalMixin2 {}
-// ^^^^^
-// [analyzer] COMPILE_TIME_ERROR.SUBTYPE_OF_BASE_OR_FINAL_IS_NOT_BASE_FINAL_OR_SEALED
-// [cfe] The type 'With2' must be 'base', 'final' or 'sealed' because the supertype 'FinalMixin' is 'final'.
-
mixin On on FinalClass {}
// ^^
// [analyzer] COMPILE_TIME_ERROR.SUBTYPE_OF_BASE_OR_FINAL_IS_NOT_BASE_FINAL_OR_SEALED
@@ -53,15 +34,10 @@
// ^
// [cfe] The type 'ExtendsExtends' must be 'base', 'final' or 'sealed' because the supertype 'FinalClass' is 'final'.
-class Multiple extends BaseClass implements FinalMixin {}
+class Multiple extends RegularClass implements FinalClass {}
// ^^^^^^^^
// [analyzer] COMPILE_TIME_ERROR.SUBTYPE_OF_BASE_OR_FINAL_IS_NOT_BASE_FINAL_OR_SEALED
-// [cfe] The type 'Multiple' must be 'base', 'final' or 'sealed' because the supertype 'BaseClass' is 'base'.
-
-class Multiple2 extends RegularClass implements FinalClass {}
-// ^^^^^^^^^
-// [analyzer] COMPILE_TIME_ERROR.SUBTYPE_OF_BASE_OR_FINAL_IS_NOT_BASE_FINAL_OR_SEALED
-// [cfe] The type 'Multiple2' must be 'base', 'final' or 'sealed' because the supertype 'FinalClass' is 'final'.
+// [cfe] The type 'Multiple' must be 'base', 'final' or 'sealed' because the supertype 'FinalClass' is 'final'.
class IndirectSubtype extends SubtypeOfFinal {}
// ^^^^^^^^^^^^^^^
diff --git a/tests/language/class_modifiers/final/final_class_subtype_base_final_or_sealed_test.dart b/tests/language/class_modifiers/final/final_class_subtype_base_final_or_sealed_test.dart
index 1cae8cb..6940d4d 100644
--- a/tests/language/class_modifiers/final/final_class_subtype_base_final_or_sealed_test.dart
+++ b/tests/language/class_modifiers/final/final_class_subtype_base_final_or_sealed_test.dart
@@ -12,49 +12,39 @@
final class FinalClass {
int foo = 0;
}
-final mixin FinalMixin {
- int foo = 0;
-}
base class BaseExtends extends FinalClass {}
+
final class FinalExtends extends FinalClass {}
+
sealed class SealedExtends extends FinalClass {}
+
final class SealedExtendsImpl extends SealedExtends {}
base class BaseImplements implements FinalClass {
int foo = 0;
}
+
final class FinalImplements implements FinalClass {
int foo = 0;
}
+
sealed class SealedImplements implements FinalClass {
int foo = 0;
}
+
final class SealedImplementsImpl extends SealedImplements {}
-base mixin BaseMixinImplements implements FinalMixin {}
-final mixin FinalMixinImplements implements FinalMixin {}
-sealed mixin SealedMixinImplements implements FinalMixin {}
-
-final class ImplementsImpl implements BaseMixinImplements, FinalMixinImplements, SealedMixinImplements {
- int foo = 0;
-}
-
-base class BaseWith with FinalMixin {}
-final class FinalWith with FinalMixin {}
-sealed class SealedWith with FinalMixin {}
-final class SealedWithImpl extends SealedWith {}
-
base mixin BaseOn on FinalClass {}
-final mixin FinalOn on FinalClass {}
-sealed mixin SealedOn on FinalClass {}
-final class OnImpl implements BaseOn, FinalOn, SealedOn {
+final class OnImpl implements BaseOn {
int foo = 0;
}
base mixin MixinForEnum {}
+
enum EnumWith with MixinForEnum { x }
+
enum EnumImplements implements MixinForEnum { x }
main() {
@@ -64,10 +54,6 @@
Expect.equals(0, BaseImplements().foo);
Expect.equals(0, FinalImplements().foo);
Expect.equals(0, SealedImplementsImpl().foo);
- Expect.equals(0, ImplementsImpl().foo);
- Expect.equals(0, BaseWith().foo);
- Expect.equals(0, FinalWith().foo);
- Expect.equals(0, SealedWithImpl().foo);
Expect.equals(0, OnImpl().foo);
Expect.equals(0, EnumWith.x.index);
Expect.equals(0, EnumImplements.x.index);
diff --git a/tests/language/class_modifiers/final/final_mixin_implement_lib.dart b/tests/language/class_modifiers/final/final_mixin_implement_lib.dart
deleted file mode 100644
index b552fcb..0000000
--- a/tests/language/class_modifiers/final/final_mixin_implement_lib.dart
+++ /dev/null
@@ -1,25 +0,0 @@
-// Copyright (c) 2022, 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=class-modifiers
-
-// Allow final mixins to be implemented by multiple classes in the same library.
-
-final mixin FinalMixin {
- int foo = 0;
-}
-
-final mixin MixinForEnum {}
-
-abstract final class A implements FinalMixin {}
-
-final class AImpl implements A {
- int foo = 1;
-}
-
-final class B implements FinalMixin {
- int foo = 1;
-}
-
-enum EnumInside implements MixinForEnum { x }
diff --git a/tests/language/class_modifiers/final/final_mixin_implement_outside_error_test.dart b/tests/language/class_modifiers/final/final_mixin_implement_outside_error_test.dart
deleted file mode 100644
index d4c62c2..0000000
--- a/tests/language/class_modifiers/final/final_mixin_implement_outside_error_test.dart
+++ /dev/null
@@ -1,26 +0,0 @@
-// Copyright (c) 2022, 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=class-modifiers
-
-// Error when attempting to implement final mixin outside of library.
-
-import 'final_mixin_implement_lib.dart';
-
-abstract final class AOutside implements FinalMixin {}
-// ^^^^^^^^^^
-// [analyzer] COMPILE_TIME_ERROR.INVALID_USE_OF_TYPE_OUTSIDE_LIBRARY
-// [cfe] The mixin 'FinalMixin' can't be implemented outside of its library because it's a final mixin.
-
-final class BOutside implements FinalMixin {
-// ^^^^^^^^^^
-// [analyzer] COMPILE_TIME_ERROR.INVALID_USE_OF_TYPE_OUTSIDE_LIBRARY
-// [cfe] The mixin 'FinalMixin' can't be implemented outside of its library because it's a final mixin.
- int foo = 1;
-}
-
-enum EnumOutside implements MixinForEnum { x }
-// ^^^^^^^^^^^^
-// [analyzer] COMPILE_TIME_ERROR.INVALID_USE_OF_TYPE_OUTSIDE_LIBRARY
-// [cfe] The mixin 'MixinForEnum' can't be implemented outside of its library because it's a final mixin.
diff --git a/tests/language/class_modifiers/final/final_mixin_implement_test.dart b/tests/language/class_modifiers/final/final_mixin_implement_test.dart
deleted file mode 100644
index 32631d1..0000000
--- a/tests/language/class_modifiers/final/final_mixin_implement_test.dart
+++ /dev/null
@@ -1,16 +0,0 @@
-// Copyright (c) 2022, 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=class-modifiers
-
-// Allow final mixins to be implemented by multiple classes in the same library.
-
-import 'package:expect/expect.dart';
-import 'final_mixin_implement_lib.dart';
-
-main() {
- Expect.equals(1, AImpl().foo);
- Expect.equals(1, B().foo);
- Expect.equals(0, EnumInside.x.index);
-}
diff --git a/tests/language/class_modifiers/final/final_mixin_typedef_with_lib.dart b/tests/language/class_modifiers/final/final_mixin_typedef_with_lib.dart
deleted file mode 100644
index db19f3d..0000000
--- a/tests/language/class_modifiers/final/final_mixin_typedef_with_lib.dart
+++ /dev/null
@@ -1,18 +0,0 @@
-// Copyright (c) 2022, 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=class-modifiers
-
-// Other-library declarations used by
-// final_mixin_typedef_with_outside_error_test.dart.
-
-final mixin FinalMixin {
- int foo = 0;
-}
-
-typedef FinalMixinTypeDef = FinalMixin;
-
-final class A with FinalMixinTypeDef {
- int foo = 1;
-}
diff --git a/tests/language/class_modifiers/final/final_mixin_typedef_with_outside_error_test.dart b/tests/language/class_modifiers/final/final_mixin_typedef_with_outside_error_test.dart
deleted file mode 100644
index 88a1095..0000000
--- a/tests/language/class_modifiers/final/final_mixin_typedef_with_outside_error_test.dart
+++ /dev/null
@@ -1,19 +0,0 @@
-// Copyright (c) 2022, 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=class-modifiers
-
-// Error when attempting to mix in a typedef final mixin outside of library.
-
-import 'final_mixin_typedef_with_lib.dart';
-
-abstract final class AOutside with FinalMixinTypeDef {}
-// ^^^^^^^^^^^^^^^^^
-// [analyzer] COMPILE_TIME_ERROR.INVALID_USE_OF_TYPE_OUTSIDE_LIBRARY
-// [cfe] The mixin 'FinalMixin' can't be mixed-in outside of its library because it's a final mixin.
-
-final class BOutside with FinalMixinTypeDef {}
-// ^^^^^^^^^^^^^^^^^
-// [analyzer] COMPILE_TIME_ERROR.INVALID_USE_OF_TYPE_OUTSIDE_LIBRARY
-// [cfe] The mixin 'FinalMixin' can't be mixed-in outside of its library because it's a final mixin.
diff --git a/tests/language/class_modifiers/final/final_mixin_typedef_with_test.dart b/tests/language/class_modifiers/final/final_mixin_typedef_with_test.dart
deleted file mode 100644
index 7d138dc..0000000
--- a/tests/language/class_modifiers/final/final_mixin_typedef_with_test.dart
+++ /dev/null
@@ -1,15 +0,0 @@
-// Copyright (c) 2022, 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=class-modifiers
-
-// Allow typedef final mixins to be mixed in by multiple classes in the same
-// library.
-
-import 'package:expect/expect.dart';
-import 'final_mixin_typedef_with_lib.dart';
-
-main() {
- Expect.equals(1, A().foo);
-}
diff --git a/tests/language/class_modifiers/final/final_mixin_with_lib.dart b/tests/language/class_modifiers/final/final_mixin_with_lib.dart
deleted file mode 100644
index 083a263..0000000
--- a/tests/language/class_modifiers/final/final_mixin_with_lib.dart
+++ /dev/null
@@ -1,21 +0,0 @@
-// Copyright (c) 2022, 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=class-modifiers
-
-// Allow final mixins to be mixed by multiple classes in the same library.
-
-final mixin FinalMixin {
- int foo = 0;
-}
-
-final mixin MixinForEnum {}
-
-abstract final class A with FinalMixin {}
-
-final class AImpl extends A {}
-
-final class B with FinalMixin {}
-
-enum EnumInside with MixinForEnum { x }
diff --git a/tests/language/class_modifiers/final/final_mixin_with_outside_error_test.dart b/tests/language/class_modifiers/final/final_mixin_with_outside_error_test.dart
deleted file mode 100644
index a6df5f3..0000000
--- a/tests/language/class_modifiers/final/final_mixin_with_outside_error_test.dart
+++ /dev/null
@@ -1,24 +0,0 @@
-// Copyright (c) 2022, 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=class-modifiers
-
-// Error when attempting to mix in final mixin outside of library.
-
-import 'final_mixin_with_lib.dart';
-
-abstract final class AOutside with FinalMixin {}
-// ^^^^^^^^^^
-// [analyzer] COMPILE_TIME_ERROR.INVALID_USE_OF_TYPE_OUTSIDE_LIBRARY
-// [cfe] The mixin 'FinalMixin' can't be mixed-in outside of its library because it's a final mixin.
-
-final class BOutside with FinalMixin {}
-// ^^^^^^^^^^
-// [analyzer] COMPILE_TIME_ERROR.INVALID_USE_OF_TYPE_OUTSIDE_LIBRARY
-// [cfe] The mixin 'FinalMixin' can't be mixed-in outside of its library because it's a final mixin.
-
-enum EnumOutside with MixinForEnum { x }
-// ^^^^^^^^^^^^
-// [analyzer] COMPILE_TIME_ERROR.INVALID_USE_OF_TYPE_OUTSIDE_LIBRARY
-// [cfe] The mixin 'MixinForEnum' can't be mixed-in outside of its library because it's a final mixin.
diff --git a/tests/language/class_modifiers/final/final_mixin_with_test.dart b/tests/language/class_modifiers/final/final_mixin_with_test.dart
deleted file mode 100644
index c1567dd..0000000
--- a/tests/language/class_modifiers/final/final_mixin_with_test.dart
+++ /dev/null
@@ -1,16 +0,0 @@
-// Copyright (c) 2022, 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=class-modifiers
-
-// Allow final mixins to be mixed by multiple classes in the same library.
-
-import 'package:expect/expect.dart';
-import 'final_mixin_with_lib.dart';
-
-main() {
- Expect.equals(0, AImpl().foo);
- Expect.equals(0, B().foo);
- Expect.equals(0, EnumInside.x.index);
-}
diff --git a/tests/language/class_modifiers/interface/interface_class_interface_subtype_test.dart b/tests/language/class_modifiers/interface/interface_class_interface_subtype_test.dart
index 911c3b7..4c5b6e0 100644
--- a/tests/language/class_modifiers/interface/interface_class_interface_subtype_test.dart
+++ b/tests/language/class_modifiers/interface/interface_class_interface_subtype_test.dart
@@ -11,26 +11,19 @@
interface class InterfaceClass {
int foo = 0;
}
+
interface class A extends InterfaceClass {}
+
interface class B implements InterfaceClass {
int foo = 1;
}
-interface mixin InterfaceMixin {
- int foo = 0;
-}
-interface class AMixin with InterfaceMixin {}
-interface class BMixin = Object with InterfaceMixin;
-
// Used for trivial runtime tests of the interface subtypes.
class AConcrete extends A {}
+
class BConcrete extends B {}
-class AMixinConcrete extends AMixin {}
-class BMixinConcrete extends BMixin {}
main() {
Expect.equals(0, AConcrete().foo);
Expect.equals(1, BConcrete().foo);
- Expect.equals(0, AMixinConcrete().foo);
- Expect.equals(0, BMixinConcrete().foo);
}
diff --git a/tests/language/class_modifiers/interface/interface_class_mixin_on_lib.dart b/tests/language/class_modifiers/interface/interface_class_mixin_on_lib.dart
index 5f01763..bbd3335 100644
--- a/tests/language/class_modifiers/interface/interface_class_mixin_on_lib.dart
+++ b/tests/language/class_modifiers/interface/interface_class_mixin_on_lib.dart
@@ -11,9 +11,3 @@
abstract class A extends InterfaceClass {}
class B extends InterfaceClass {}
-
-interface mixin InterfaceMixin {}
-
-class C extends InterfaceClass with InterfaceMixin {}
-
-class D with InterfaceMixin {}
diff --git a/tests/language/class_modifiers/interface/interface_class_mixin_on_test.dart b/tests/language/class_modifiers/interface/interface_class_mixin_on_test.dart
index 096d961..5ccfacf 100644
--- a/tests/language/class_modifiers/interface/interface_class_mixin_on_test.dart
+++ b/tests/language/class_modifiers/interface/interface_class_mixin_on_test.dart
@@ -17,20 +17,6 @@
int foo = 0;
}
-mixin MC on InterfaceClass, InterfaceMixin {}
-
-class ConcreteC extends C with MC {
- int foo = 0;
-}
-
-mixin MCSingular on InterfaceMixin {}
-
-class ConcreteD extends D with MCSingular {
- int foo = 0;
-}
-
main() {
Expect.equals(0, ConcreteA().foo);
- Expect.equals(0, ConcreteC().foo);
- Expect.equals(0, ConcreteD().foo);
}
diff --git a/tests/language/class_modifiers/interface/interface_mixin_implement_lib.dart b/tests/language/class_modifiers/interface/interface_mixin_implement_lib.dart
deleted file mode 100644
index 06f0af6..0000000
--- a/tests/language/class_modifiers/interface/interface_mixin_implement_lib.dart
+++ /dev/null
@@ -1,20 +0,0 @@
-// Copyright (c) 2022, 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=class-modifiers
-
-// Allow interface mixins to be implemented by multiple classes in the same
-// library.
-
-interface mixin InterfaceMixin {
- int foo = 0;
-}
-
-interface mixin MixinForEnum {}
-
-abstract class A implements InterfaceMixin {}
-
-class B implements InterfaceMixin {
- int foo = 1;
-}
diff --git a/tests/language/class_modifiers/interface/interface_mixin_implement_outside_test.dart b/tests/language/class_modifiers/interface/interface_mixin_implement_outside_test.dart
deleted file mode 100644
index cf0f14e..0000000
--- a/tests/language/class_modifiers/interface/interface_mixin_implement_outside_test.dart
+++ /dev/null
@@ -1,29 +0,0 @@
-// Copyright (c) 2022, 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=class-modifiers
-
-// Allow interface mixins to be implemented by multiple classes outside its
-// library.
-
-import 'package:expect/expect.dart';
-import 'interface_mixin_implement_lib.dart';
-
-abstract class AOutside implements InterfaceMixin {}
-
-class AOutsideImpl implements AOutside {
- int foo = 1;
-}
-
-class BOutside implements InterfaceMixin {
- int foo = 1;
-}
-
-enum EnumOutside implements MixinForEnum { x }
-
-main() {
- Expect.equals(1, AOutsideImpl().foo);
- Expect.equals(1, BOutside().foo);
- Expect.equals(0, EnumOutside.x.index);
-}
diff --git a/tests/language/class_modifiers/interface/interface_mixin_typedef_with_lib.dart b/tests/language/class_modifiers/interface/interface_mixin_typedef_with_lib.dart
deleted file mode 100644
index 891b1e4..0000000
--- a/tests/language/class_modifiers/interface/interface_mixin_typedef_with_lib.dart
+++ /dev/null
@@ -1,19 +0,0 @@
-// Copyright (c) 2022, 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=class-modifiers
-
-// Other-library declarations used by
-// interface_mixin_typedef_with_outside_error_test.dart and
-// interface_mixin_typedef_with_test.dart.
-
-interface mixin InterfaceMixin {
- int foo = 0;
-}
-
-typedef InterfaceMixinTypeDef = InterfaceMixin;
-
-class A with InterfaceMixinTypeDef {
- int foo = 1;
-}
diff --git a/tests/language/class_modifiers/interface/interface_mixin_typedef_with_outside_error_test.dart b/tests/language/class_modifiers/interface/interface_mixin_typedef_with_outside_error_test.dart
deleted file mode 100644
index f9a82c8..0000000
--- a/tests/language/class_modifiers/interface/interface_mixin_typedef_with_outside_error_test.dart
+++ /dev/null
@@ -1,19 +0,0 @@
-// Copyright (c) 2022, 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=class-modifiers
-
-// Error when attempting to mix in a typedef interface mixin outside of library.
-
-import 'interface_mixin_typedef_with_lib.dart';
-
-abstract class AOutside with InterfaceMixinTypeDef {}
-// ^^^^^^^^^^^^^^^^^^^^^
-// [analyzer] COMPILE_TIME_ERROR.INVALID_USE_OF_TYPE_OUTSIDE_LIBRARY
-// [cfe] The mixin 'InterfaceMixin' can't be mixed-in outside of its library because it's an interface mixin.
-
-class BOutside with InterfaceMixinTypeDef {}
-// ^^^^^^^^^^^^^^^^^^^^^
-// [analyzer] COMPILE_TIME_ERROR.INVALID_USE_OF_TYPE_OUTSIDE_LIBRARY
-// [cfe] The mixin 'InterfaceMixin' can't be mixed-in outside of its library because it's an interface mixin.
diff --git a/tests/language/class_modifiers/interface/interface_mixin_typedef_with_test.dart b/tests/language/class_modifiers/interface/interface_mixin_typedef_with_test.dart
deleted file mode 100644
index fbbd712..0000000
--- a/tests/language/class_modifiers/interface/interface_mixin_typedef_with_test.dart
+++ /dev/null
@@ -1,15 +0,0 @@
-// Copyright (c) 2022, 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=class-modifiers
-
-// Allow typedef interface mixins to be mixed in by multiple classes in the same
-// library.
-
-import 'package:expect/expect.dart';
-import 'interface_mixin_typedef_with_lib.dart';
-
-main() {
- Expect.equals(1, A().foo);
-}
diff --git a/tests/language/class_modifiers/interface/interface_mixin_with_lib.dart b/tests/language/class_modifiers/interface/interface_mixin_with_lib.dart
deleted file mode 100644
index 18d2e26..0000000
--- a/tests/language/class_modifiers/interface/interface_mixin_with_lib.dart
+++ /dev/null
@@ -1,19 +0,0 @@
-// Copyright (c) 2022, 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=class-modifiers
-
-// Allow interface mixins to be mixed by multiple classes in the same library.
-
-interface mixin InterfaceMixin {
- int foo = 0;
-}
-
-interface mixin MixinForEnum {}
-
-abstract class A with InterfaceMixin {}
-
-class B with InterfaceMixin {}
-
-enum EnumInside implements MixinForEnum { x }
diff --git a/tests/language/class_modifiers/interface/interface_mixin_with_outside_error_test.dart b/tests/language/class_modifiers/interface/interface_mixin_with_outside_error_test.dart
deleted file mode 100644
index c60d70e..0000000
--- a/tests/language/class_modifiers/interface/interface_mixin_with_outside_error_test.dart
+++ /dev/null
@@ -1,24 +0,0 @@
-// Copyright (c) 2022, 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=class-modifiers
-
-// Error when attempting to mix in interface mixin outside of library.
-
-import 'interface_mixin_with_lib.dart';
-
-abstract class AOutside with InterfaceMixin {}
-// ^^^^^^^^^^^^^^
-// [analyzer] COMPILE_TIME_ERROR.INVALID_USE_OF_TYPE_OUTSIDE_LIBRARY
-// [cfe] The mixin 'InterfaceMixin' can't be mixed-in outside of its library because it's an interface mixin.
-
-class BOutside with InterfaceMixin {}
-// ^^^^^^^^^^^^^^
-// [analyzer] COMPILE_TIME_ERROR.INVALID_USE_OF_TYPE_OUTSIDE_LIBRARY
-// [cfe] The mixin 'InterfaceMixin' can't be mixed-in outside of its library because it's an interface mixin.
-
-enum EnumOutside with MixinForEnum { x }
-// ^^^^^^^^^^^^
-// [analyzer] COMPILE_TIME_ERROR.INVALID_USE_OF_TYPE_OUTSIDE_LIBRARY
-// [cfe] The mixin 'MixinForEnum' can't be mixed-in outside of its library because it's an interface mixin.
diff --git a/tests/language/class_modifiers/interface/interface_mixin_with_test.dart b/tests/language/class_modifiers/interface/interface_mixin_with_test.dart
deleted file mode 100644
index a3d0412..0000000
--- a/tests/language/class_modifiers/interface/interface_mixin_with_test.dart
+++ /dev/null
@@ -1,18 +0,0 @@
-// Copyright (c) 2022, 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=class-modifiers
-
-// Allow interface mixins to be mixed by multiple classes in the same library.
-
-import 'package:expect/expect.dart';
-import 'interface_mixin_with_lib.dart';
-
-class AImpl extends A {}
-
-main() {
- Expect.equals(0, AImpl().foo);
- Expect.equals(0, B().foo);
- Expect.equals(0, EnumInside.x.index);
-}
diff --git a/tests/language/class_modifiers/legacy/final_class_syntax_disabled_error_test.dart b/tests/language/class_modifiers/legacy/final_class_syntax_disabled_error_test.dart
index 0178696..81cfecd 100644
--- a/tests/language/class_modifiers/legacy/final_class_syntax_disabled_error_test.dart
+++ b/tests/language/class_modifiers/legacy/final_class_syntax_disabled_error_test.dart
@@ -18,8 +18,3 @@
// [error column 1, length 5]
// [analyzer] SYNTACTIC_ERROR.EXPERIMENT_NOT_ENABLED
// [cfe] The 'class-modifiers' language feature is disabled for this library.
-
-final mixin FinalMixin {}
-// [error column 1, length 5]
-// [analyzer] SYNTACTIC_ERROR.EXPERIMENT_NOT_ENABLED
-// [cfe] The 'class-modifiers' language feature is disabled for this library.
diff --git a/tests/language/class_modifiers/legacy/interface_class_syntax_disabled_error_test.dart b/tests/language/class_modifiers/legacy/interface_class_syntax_disabled_error_test.dart
index b49f305..1c12647 100644
--- a/tests/language/class_modifiers/legacy/interface_class_syntax_disabled_error_test.dart
+++ b/tests/language/class_modifiers/legacy/interface_class_syntax_disabled_error_test.dart
@@ -18,8 +18,3 @@
// [error column 1, length 9]
// [analyzer] SYNTACTIC_ERROR.EXPERIMENT_NOT_ENABLED
// [cfe] The 'class-modifiers' language feature is disabled for this library.
-
-interface mixin InterfaceMixin {}
-// [error column 1, length 9]
-// [analyzer] SYNTACTIC_ERROR.EXPERIMENT_NOT_ENABLED
-// [cfe] The 'class-modifiers' language feature is disabled for this library.
diff --git a/tests/language/sealed_class/sealed_class_as_mixin_error_test.dart b/tests/language/sealed_class/sealed_class_as_mixin_error_test.dart
index 25f659e..2a70f9a 100644
--- a/tests/language/sealed_class/sealed_class_as_mixin_error_test.dart
+++ b/tests/language/sealed_class/sealed_class_as_mixin_error_test.dart
@@ -42,15 +42,7 @@
// [analyzer] COMPILE_TIME_ERROR.CLASS_USED_AS_MIXIN
// [cfe] The class 'Class' can't be used as a mixin because it isn't a mixin class nor a mixin.
-class OutsideE with Class, SealedMixin {}
-// ^^^^^
-// [analyzer] COMPILE_TIME_ERROR.CLASS_USED_AS_MIXIN
-// [cfe] The class 'Class' can't be used as a mixin because it isn't a mixin class nor a mixin.
-// ^^^^^^^^^^^
-// [analyzer] COMPILE_TIME_ERROR.INVALID_USE_OF_TYPE_OUTSIDE_LIBRARY
-// [cfe] The mixin 'SealedMixin' can't be mixed in outside of its library because it's a sealed mixin.
-
-abstract class OutsideF with Mixin, SealedClass {}
+abstract class OutsideE with Mixin, SealedClass {}
// ^^^^^^^^^^^
// [analyzer] COMPILE_TIME_ERROR.CLASS_USED_AS_MIXIN
// [analyzer] COMPILE_TIME_ERROR.INVALID_USE_OF_TYPE_OUTSIDE_LIBRARY
diff --git a/tests/language/sealed_class/sealed_class_as_mixin_lib.dart b/tests/language/sealed_class/sealed_class_as_mixin_lib.dart
index ff5bf14..40058d3 100644
--- a/tests/language/sealed_class/sealed_class_as_mixin_lib.dart
+++ b/tests/language/sealed_class/sealed_class_as_mixin_lib.dart
@@ -12,6 +12,7 @@
int nonAbstractBar(int value) => value + 100;
int bar(int value);
}
-sealed mixin SealedMixin {}
+
class Class {}
+
mixin Mixin {}
diff --git a/tests/language/sealed_class/sealed_class_construct_error_test.dart b/tests/language/sealed_class/sealed_class_construct_error_test.dart
index 9df3a4c..1aeaf01 100644
--- a/tests/language/sealed_class/sealed_class_construct_error_test.dart
+++ b/tests/language/sealed_class/sealed_class_construct_error_test.dart
@@ -9,8 +9,6 @@
sealed class NotConstructable {}
-sealed mixin AlsoNotConstructable {}
-
mixin M {}
sealed class NotConstructableWithMixin = Object with M;
@@ -19,10 +17,6 @@
// ^^^^^^^^^^^^^^^^
// [analyzer] COMPILE_TIME_ERROR.INSTANTIATE_ABSTRACT_CLASS
// [cfe] The class 'NotConstructable' is abstract and can't be instantiated.
- var error2 = AlsoNotConstructable();
- // ^^^^^^^^^^^^^^^^^^^^
- // [analyzer] COMPILE_TIME_ERROR.MIXIN_INSTANTIATE
- // [cfe] Couldn't find constructor 'AlsoNotConstructable'.
var error3 = NotConstructableWithMixin();
// ^^^^^^^^^^^^^^^^^^^^^^^^^
// [analyzer] COMPILE_TIME_ERROR.INSTANTIATE_ABSTRACT_CLASS
diff --git a/tests/language/sealed_class/sealed_class_sealed_subtype_test.dart b/tests/language/sealed_class/sealed_class_sealed_subtype_test.dart
index 0df4ff3..79487ea 100644
--- a/tests/language/sealed_class/sealed_class_sealed_subtype_test.dart
+++ b/tests/language/sealed_class/sealed_class_sealed_subtype_test.dart
@@ -10,23 +10,18 @@
sealed class SealedClass {
int foo = 0;
}
+
sealed class A extends SealedClass {}
+
sealed class B implements SealedClass {
@override
int foo = 1;
}
-sealed mixin SealedMixin {
- int foo = 0;
-}
-sealed class AMixin with SealedMixin {}
-sealed class BMixin = Object with SealedMixin;
-
// Used for trivial runtime tests of the sealed subtypes.
class AConcrete extends A {}
+
class BConcrete extends B {}
-class AMixinConcrete extends AMixin {}
-class BMixinConcrete extends BMixin {}
main() {
var a = AConcrete();
@@ -34,10 +29,4 @@
var b = BConcrete();
Expect.equals(1, b.foo);
-
- var amixin = AMixinConcrete();
- Expect.equals(0, amixin.foo);
-
- var bmixin = BMixinConcrete();
- Expect.equals(0, bmixin.foo);
-}
\ No newline at end of file
+}
diff --git a/tests/language/sealed_class/sealed_class_syntax_disabled_error_test.dart b/tests/language/sealed_class/sealed_class_syntax_disabled_error_test.dart
index 9d1e07d..3083e7f 100644
--- a/tests/language/sealed_class/sealed_class_syntax_disabled_error_test.dart
+++ b/tests/language/sealed_class/sealed_class_syntax_disabled_error_test.dart
@@ -29,8 +29,3 @@
// [error column 1, length 6]
// [analyzer] SYNTACTIC_ERROR.EXPERIMENT_NOT_ENABLED
// [cfe] The 'sealed-class' language feature is disabled for this library.
-
-sealed mixin SealedMixin {}
-// [error column 1, length 6]
-// [analyzer] SYNTACTIC_ERROR.EXPERIMENT_NOT_ENABLED
-// [cfe] The 'sealed-class' language feature is disabled for this library.
diff --git a/tests/language/sealed_class/sealed_mixin_typedef_error_test.dart b/tests/language/sealed_class/sealed_mixin_typedef_error_test.dart
deleted file mode 100644
index 3e42f2a..0000000
--- a/tests/language/sealed_class/sealed_mixin_typedef_error_test.dart
+++ /dev/null
@@ -1,14 +0,0 @@
-// Copyright (c) 2022, 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=sealed-class
-
-// Error when attempting to mix in a typedef sealed mixin outside of its library
-
-import 'sealed_mixin_typedef_lib.dart';
-
-class ATypeDef with SealedMixinTypeDef {}
-// ^^^^^^^^^^^^^^^^^^
-// [analyzer] COMPILE_TIME_ERROR.INVALID_USE_OF_TYPE_OUTSIDE_LIBRARY
-// [cfe] The mixin 'SealedMixin' can't be mixed in outside of its library because it's a sealed mixin.
diff --git a/tests/language/sealed_class/sealed_mixin_typedef_lib.dart b/tests/language/sealed_class/sealed_mixin_typedef_lib.dart
deleted file mode 100644
index 44779d5..0000000
--- a/tests/language/sealed_class/sealed_mixin_typedef_lib.dart
+++ /dev/null
@@ -1,15 +0,0 @@
-// Copyright (c) 2022, 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=sealed-class
-
-// Other-library declarations used by sealed_mixin_typedef_test.dart.
-
-sealed mixin SealedMixin {
- int foo = 0;
-}
-
-typedef SealedMixinTypeDef = SealedMixin;
-
-class A with SealedMixinTypeDef {}
diff --git a/tests/language/sealed_class/sealed_mixin_typedef_test.dart b/tests/language/sealed_class/sealed_mixin_typedef_test.dart
deleted file mode 100644
index 9c63a5f..0000000
--- a/tests/language/sealed_class/sealed_mixin_typedef_test.dart
+++ /dev/null
@@ -1,15 +0,0 @@
-// Copyright (c) 2022, 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=sealed-class
-
-// Allow typedef sealed mixins to be mixed in by classes in the same library.
-
-import "package:expect/expect.dart";
-import 'sealed_mixin_typedef_lib.dart';
-
-main() {
- var a = A();
- Expect.equals(0, a.foo);
-}
diff --git a/tests/language/sealed_class/sealed_mixin_with_error_test.dart b/tests/language/sealed_class/sealed_mixin_with_error_test.dart
deleted file mode 100644
index de8e949..0000000
--- a/tests/language/sealed_class/sealed_mixin_with_error_test.dart
+++ /dev/null
@@ -1,32 +0,0 @@
-// Copyright (c) 2022, 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=sealed-class
-
-// Error when attempting to mix in a sealed mixin outside of its library.
-
-import 'sealed_mixin_with_lib.dart';
-
-abstract class OutsideA with SealedMixin {}
-// ^^^^^^^^^^^
-// [analyzer] COMPILE_TIME_ERROR.INVALID_USE_OF_TYPE_OUTSIDE_LIBRARY
-// [cfe] The mixin 'SealedMixin' can't be mixed in outside of its library because it's a sealed mixin.
-
-class OutsideB with SealedMixin {
-// ^^^^^^^^^^^
-// [analyzer] COMPILE_TIME_ERROR.INVALID_USE_OF_TYPE_OUTSIDE_LIBRARY
-// [cfe] The mixin 'SealedMixin' can't be mixed in outside of its library because it's a sealed mixin.
- int foo = 2;
- int bar(int value) => value;
-}
-
-abstract class OutsideC = Object with SealedMixin;
-// ^^^^^^^^^^^
-// [analyzer] COMPILE_TIME_ERROR.INVALID_USE_OF_TYPE_OUTSIDE_LIBRARY
-// [cfe] The mixin 'SealedMixin' can't be mixed in outside of its library because it's a sealed mixin.
-
-enum EnumOutside with MixinForEnum { x }
-// ^^^^^^^^^^^^
-// [analyzer] COMPILE_TIME_ERROR.INVALID_USE_OF_TYPE_OUTSIDE_LIBRARY
-// [cfe] The mixin 'MixinForEnum' can't be mixed in outside of its library because it's a sealed mixin.
diff --git a/tests/language/sealed_class/sealed_mixin_with_lib.dart b/tests/language/sealed_class/sealed_mixin_with_lib.dart
deleted file mode 100644
index b10c0a0..0000000
--- a/tests/language/sealed_class/sealed_mixin_with_lib.dart
+++ /dev/null
@@ -1,39 +0,0 @@
-// Copyright (c) 2022, 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=sealed-class
-
-// Other-library declarations used by sealed_mixin_with_error_test.dart and
-// sealed_mixin_with_test.dart.
-
-sealed mixin SealedMixin {
- int nonAbstractFoo = 0;
- abstract int foo;
- int nonAbstractBar(int value) => value + 100;
- int bar(int value);
-}
-
-sealed mixin MixinForEnum {}
-
-abstract class A with SealedMixin {}
-
-class AImpl extends A {
- int foo = 1;
- int bar(int value) => value + 1;
-}
-
-class B with SealedMixin {
- int nonAbstractFoo = 100;
- int foo = 2;
- int bar(int value) => value;
-}
-
-abstract class C = Object with SealedMixin;
-
-class CImpl extends C {
- int foo = 3;
- int bar(int value) => value - 1;
-}
-
-enum EnumInside with MixinForEnum { x }
diff --git a/tests/language/sealed_class/sealed_mixin_with_test.dart b/tests/language/sealed_class/sealed_mixin_with_test.dart
deleted file mode 100644
index 4c12f79..0000000
--- a/tests/language/sealed_class/sealed_mixin_with_test.dart
+++ /dev/null
@@ -1,57 +0,0 @@
-// Copyright (c) 2022, 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=sealed-class
-
-// Allow sealed mixins to be mixed in by multiple classes in the same library.
-// Additionally, allow their subclasses/subtypes to be used freely.
-
-import "package:expect/expect.dart";
-import 'sealed_mixin_with_lib.dart';
-
-class AExtends extends A {
- int foo = 0;
- int bar(int value) => value;
-}
-
-class AImplements implements A {
- int nonAbstractFoo = 0;
- int foo = 0;
- int bar(int value) => value;
- int nonAbstractBar(int value) => value;
-}
-
-main() {
- A a = AImpl();
- Expect.equals(0, a.nonAbstractFoo);
- Expect.equals(1, a.foo);
- Expect.equals(3, a.bar(2));
- Expect.equals(100, a.nonAbstractBar(0));
-
- var b = B();
- Expect.equals(100, b.nonAbstractFoo);
- Expect.equals(2, b.foo);
- Expect.equals(2, b.bar(2));
- Expect.equals(100, b.nonAbstractBar(0));
-
- C c = CImpl();
- Expect.equals(0, c.nonAbstractFoo);
- Expect.equals(3, c.foo);
- Expect.equals(1, c.bar(2));
- Expect.equals(100, c.nonAbstractBar(0));
-
- var aExtends = AExtends();
- Expect.equals(0, aExtends.nonAbstractFoo);
- Expect.equals(0, aExtends.foo);
- Expect.equals(0, aExtends.bar(0));
- Expect.equals(100, aExtends.nonAbstractBar(0));
-
- var aImplements = AImplements();
- Expect.equals(0, aImplements.nonAbstractFoo);
- Expect.equals(0, aImplements.foo);
- Expect.equals(0, aImplements.bar(0));
- Expect.equals(0, aImplements.nonAbstractBar(0));
-
- Expect.equals(0, EnumInside.x.index);
-}
To view, visit change 291047. To unsubscribe, or for help writing mail filters, visit settings.
Attention is currently required from: Leaf Petersen.
Attention is currently required from: Leaf Petersen.
go/dart-cbuild result: SUCCESS
Details: https://goto.google.com/dart-cbuild/find/874b37e4417732e445afedfcac71d625231e9825
Attention is currently required from: Kallen Tu.
Patch set 2:Code-Review +1
1 comment:
Patchset:
Thanks! Sorry for the unnecessary work on these.
To view, visit change 291047. To unsubscribe, or for help writing mail filters, visit settings.
Attention is currently required from: Kallen Tu.
Patch set 2:Commit-Queue +2
Commit Queue submitted this change.
[tests] Remove interface mixin, final mixin, and sealed mixin from language tests.
Change-Id: I8d92758c3a43ed0eff2e0c953ae8a87e65a3a920
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/291047
Commit-Queue: Kallen Tu <kall...@google.com>
Reviewed-by: Leaf Petersen <le...@google.com>
To view, visit change 291047. To unsubscribe, or for help writing mail filters, visit settings.
go/dart-cbuild result: SUCCESS
Details: https://goto.google.com/dart-cbuild/find/fd1b48d82eecdf4782ef26a7006ab7ab1fc16e1a