dart-sdk/tests/language/mixin/illegal_cycles_test.dart
Robert Nystrom 7ca5ad46ce Set tests that have mixin errors as 2.19.
Mark tests that contain errors about using a class as a mixin to use
language version 2.19 where that's not an error.

This may not fix all of the tests because it's the language version of
the library where the class is declared that matters, not where the
class is used as a mixin. But most tests have all of their declarations
in the same library, so this should fix most.

Change-Id: I910439ebd2f10f731418dc588b7e4619a0841c16
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/285923
Reviewed-by: Jake Macdonald <jakemac@google.com>
Commit-Queue: Jake Macdonald <jakemac@google.com>
2023-03-01 15:03:39 +00:00

91 lines
2.6 KiB
Dart

// 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.
// TODO(51557): Decide if the mixins being applied in this test should be
// "mixin", "mixin class" or the test should be left at 2.19.
// @dart=2.19
class M {}
class M0 extends Object with M0 { }
// ^^
// [analyzer] COMPILE_TIME_ERROR.RECURSIVE_INTERFACE_INHERITANCE
// [cfe] 'M0' is a supertype of itself.
// ^
// [cfe] 'Object with M0' is a supertype of itself.
// ^^
// [analyzer] COMPILE_TIME_ERROR.MIXIN_INHERITS_FROM_NOT_OBJECT
class M1 = Object with M1;
// ^^
// [analyzer] COMPILE_TIME_ERROR.RECURSIVE_INTERFACE_INHERITANCE
// [cfe] 'M1' is a supertype of itself.
class M2 = Object with M3;
// ^^
// [analyzer] COMPILE_TIME_ERROR.RECURSIVE_INTERFACE_INHERITANCE
// [cfe] 'M2' is a supertype of itself.
class M3 = Object with M2;
// ^^
// [analyzer] COMPILE_TIME_ERROR.RECURSIVE_INTERFACE_INHERITANCE
// [cfe] 'M3' is a supertype of itself.
class M4 = Object with M5;
// ^^
// [analyzer] COMPILE_TIME_ERROR.RECURSIVE_INTERFACE_INHERITANCE
// [cfe] 'M4' is a supertype of itself.
class M5 = Object with M6;
// ^^
// [analyzer] COMPILE_TIME_ERROR.RECURSIVE_INTERFACE_INHERITANCE
// [cfe] 'M5' is a supertype of itself.
class M6 = Object with M4;
// ^^
// [analyzer] COMPILE_TIME_ERROR.RECURSIVE_INTERFACE_INHERITANCE
// [cfe] 'M6' is a supertype of itself.
class M7 extends Object with M8 { }
// ^^
// [analyzer] COMPILE_TIME_ERROR.RECURSIVE_INTERFACE_INHERITANCE
// [cfe] 'M7' is a supertype of itself.
// ^
// [cfe] 'Object with M8' is a supertype of itself.
// ^^
// [analyzer] COMPILE_TIME_ERROR.MIXIN_INHERITS_FROM_NOT_OBJECT
class M8 extends Object with M7 { }
// ^^
// [analyzer] COMPILE_TIME_ERROR.RECURSIVE_INTERFACE_INHERITANCE
// [cfe] 'M8' is a supertype of itself.
// ^
// [cfe] 'Object with M7' is a supertype of itself.
// ^^
// [analyzer] COMPILE_TIME_ERROR.MIXIN_INHERITS_FROM_NOT_OBJECT
class M9 = Object with M91;
// ^
// [cfe] 'M9' is a supertype of itself.
class M91 = Object with M92;
// ^^^
// [analyzer] COMPILE_TIME_ERROR.RECURSIVE_INTERFACE_INHERITANCE
// [cfe] 'M91' is a supertype of itself.
class M92 = Object with M91;
// ^^^
// [analyzer] COMPILE_TIME_ERROR.RECURSIVE_INTERFACE_INHERITANCE
// [cfe] 'M92' is a supertype of itself.
main() {
new M0();
new M1();
new M2();
new M3();
new M4();
new M5();
new M6();
new M7();
new M8();
new M9();
}