2edcad4892
Cleaned up and formatted the tests, regenerated some errors where they were "unspecified", and removed the experiment flag enabling in each test. Bug: https://github.com/dart-lang/sdk/issues/61687 Change-Id: Ic5b652af660cbc4f71731b1547c7a58c7726faca Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/503500 Reviewed-by: Erik Ernst <eernst@google.com> Commit-Queue: Kallen Tu <kallentu@google.com>
46 lines
1.7 KiB
Dart
46 lines
1.7 KiB
Dart
// Copyright (c) 2026, 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.
|
|
|
|
// Tests cycle errors for primary constructors.
|
|
|
|
class A() extends C {}
|
|
// ^
|
|
// [analyzer] COMPILE_TIME_ERROR.RECURSIVE_INTERFACE_INHERITANCE
|
|
// [cfe] 'A' is a supertype of itself.
|
|
|
|
class B() extends A {}
|
|
// ^
|
|
// [analyzer] COMPILE_TIME_ERROR.RECURSIVE_INTERFACE_INHERITANCE
|
|
// [cfe] 'B' is a supertype of itself.
|
|
|
|
class C() extends B {}
|
|
// ^
|
|
// [analyzer] COMPILE_TIME_ERROR.RECURSIVE_INTERFACE_INHERITANCE
|
|
// [cfe] 'C' is a supertype of itself.
|
|
|
|
|
|
class SuperA(super.x) extends SuperC {}
|
|
// ^^^^^^
|
|
// [analyzer] COMPILE_TIME_ERROR.RECURSIVE_INTERFACE_INHERITANCE
|
|
// [cfe] 'SuperA' is a supertype of itself.
|
|
// ^
|
|
// [analyzer] COMPILE_TIME_ERROR.SUPER_FORMAL_PARAMETER_WITHOUT_ASSOCIATED_POSITIONAL
|
|
// [cfe] The super constructor has no corresponding positional parameter.
|
|
|
|
class SuperB(super.x) extends SuperA {}
|
|
// ^^^^^^
|
|
// [analyzer] COMPILE_TIME_ERROR.RECURSIVE_INTERFACE_INHERITANCE
|
|
// [cfe] 'SuperB' is a supertype of itself.
|
|
// ^
|
|
// [analyzer] COMPILE_TIME_ERROR.SUPER_FORMAL_PARAMETER_WITHOUT_ASSOCIATED_POSITIONAL
|
|
// [cfe] The super constructor has no corresponding positional parameter.
|
|
|
|
class SuperC(super.x) extends SuperB {}
|
|
// ^^^^^^
|
|
// [analyzer] COMPILE_TIME_ERROR.RECURSIVE_INTERFACE_INHERITANCE
|
|
// [cfe] 'SuperC' is a supertype of itself.
|
|
// ^
|
|
// [analyzer] COMPILE_TIME_ERROR.SUPER_FORMAL_PARAMETER_WITHOUT_ASSOCIATED_POSITIONAL
|
|
// [cfe] The super constructor has no corresponding positional parameter.
|