[cfe] Report error on indirect implementation of base class

Closes #52161

Change-Id: I9e2f441036cfeeb904a3e3ec5aeff2e5c45cb8a7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/298160
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
This commit is contained in:
Johnni Winther 2023-04-26 08:16:34 +00:00 committed by Commit Queue
parent 9a5de8e2ea
commit 2a82ba0f48
14 changed files with 1191 additions and 52 deletions

View file

@ -2150,6 +2150,8 @@ severity: $severity
/// Reports errors for 'base', 'interface', 'final', 'mixin' and 'sealed'
/// class modifiers.
// TODO(johnniwinther): Merge supertype checking with class hierarchy
// computation to better support transitive checking.
void checkSupertypeClassModifiers(SourceClassBuilder cls,
Map<ClassBuilder, ClassBuilder> classToBaseOrFinalSuperClass) {
bool isClassModifiersEnabled(ClassBuilder typeBuilder) =>
@ -2274,9 +2276,12 @@ severity: $severity
superclass.isSealed &&
baseOrFinalSuperClass.libraryBuilder.origin !=
cls.libraryBuilder.origin) {
// This error is reported at the call site.
// TODO(johnniwinther): Merge supertype checking with class hierarchy
// computation to better support transitive checking.
// It's an error to implement a class if it has a supertype from a
// different library which is marked base.
if (baseOrFinalSuperClass.isBase) {
/*if (baseOrFinalSuperClass.isBase) {
cls.addProblem(
templateBaseClassImplementedOutsideOfLibrary
.withArguments(baseOrFinalSuperClass.fullNameForErrors),
@ -2289,7 +2294,7 @@ severity: $severity
.withLocation(baseOrFinalSuperClass.fileUri,
baseOrFinalSuperClass.charOffset, noLength)
]);
}
}*/
} else if (!cls.isBase &&
!cls.isFinal &&
!cls.isSealed &&
@ -2436,44 +2441,68 @@ severity: $severity
implementsBuilder: interfaceBuilder);
}
if (cls.libraryBuilder.origin !=
interfaceDeclaration.libraryBuilder.origin &&
!mayIgnoreClassModifiers(interfaceDeclaration)) {
// Report an error for a class implementing a base class outside
// of its library.
if (interfaceDeclaration.isBase && !cls.cls.isAnonymousMixin) {
if (interfaceDeclaration.isMixinDeclaration) {
cls.addProblem(
templateBaseMixinImplementedOutsideOfLibrary
.withArguments(
interfaceDeclaration.fullNameForErrors),
interfaceBuilder.charOffset ?? TreeNode.noOffset,
noLength);
} else {
cls.addProblem(
templateBaseClassImplementedOutsideOfLibrary
.withArguments(
interfaceDeclaration.fullNameForErrors),
interfaceBuilder.charOffset ?? TreeNode.noOffset,
noLength);
}
} else if (interfaceDeclaration.isFinal) {
if (cls.cls.isAnonymousMixin) {
cls.addProblem(
templateFinalClassUsedAsMixinConstraintOutsideOfLibrary
.withArguments(
interfaceDeclaration.fullNameForErrors),
interfaceBuilder.charOffset ?? TreeNode.noOffset,
noLength);
} else {
cls.addProblem(
templateFinalClassImplementedOutsideOfLibrary
.withArguments(
interfaceDeclaration.fullNameForErrors),
interfaceBuilder.charOffset ?? TreeNode.noOffset,
noLength);
ClassBuilder? checkedClass = interfaceDeclaration;
while (checkedClass != null) {
if (cls.libraryBuilder.origin !=
checkedClass.libraryBuilder.origin &&
!mayIgnoreClassModifiers(checkedClass)) {
// Report an error for a class implementing a base class outside
// of its library.
if (checkedClass.isBase && !cls.cls.isAnonymousMixin) {
if (checkedClass.isMixinDeclaration) {
cls.addProblem(
templateBaseMixinImplementedOutsideOfLibrary
.withArguments(checkedClass.fullNameForErrors),
interfaceBuilder.charOffset ?? TreeNode.noOffset,
noLength,
context: [
if (checkedClass != interfaceDeclaration)
templateBaseClassImplementedOutsideOfLibraryCause
.withArguments(
interfaceDeclaration.fullNameForErrors,
checkedClass.fullNameForErrors)
.withLocation(checkedClass.fileUri,
checkedClass.charOffset, noLength)
]);
} else {
cls.addProblem(
templateBaseClassImplementedOutsideOfLibrary
.withArguments(checkedClass.fullNameForErrors),
interfaceBuilder.charOffset ?? TreeNode.noOffset,
noLength,
context: [
if (checkedClass != interfaceDeclaration)
templateBaseClassImplementedOutsideOfLibraryCause
.withArguments(
interfaceDeclaration.fullNameForErrors,
checkedClass.fullNameForErrors)
.withLocation(checkedClass.fileUri,
checkedClass.charOffset, noLength)
]);
}
// Break to only report one error.
break;
} else if (checkedClass.isFinal &&
checkedClass == interfaceDeclaration) {
if (cls.cls.isAnonymousMixin) {
cls.addProblem(
templateFinalClassUsedAsMixinConstraintOutsideOfLibrary
.withArguments(
interfaceDeclaration.fullNameForErrors),
interfaceBuilder.charOffset ?? TreeNode.noOffset,
noLength);
} else {
cls.addProblem(
templateFinalClassImplementedOutsideOfLibrary
.withArguments(
interfaceDeclaration.fullNameForErrors),
interfaceBuilder.charOffset ?? TreeNode.noOffset,
noLength);
}
break;
}
}
checkedClass = classToBaseOrFinalSuperClass[checkedClass];
}
}

View file

@ -0,0 +1,36 @@
// Copyright (c) 2023, 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.
import "main_lib1.dart";
import "main_lib2.dart";
base class Base {}
base class BaseA extends A /* Ok */ {}
base class BaseA2 extends BaseA /* Ok */ {}
base class DirectA implements A /* Error */ {}
base class IndirectA implements BaseA /* Error */ {}
base class IndirectBaseA extends Base implements BaseA /* Error */ {}
base class IndirectA2 implements BaseA2 /* Error */ {}
base class IndirectBaseA2 extends Base implements BaseA2 /* Error */ {}
base class BaseB extends B /* Ok */ {}
base class BaseB2 extends BaseB /* Ok */ {}
base class DirectB implements B /* Error */ {}
base class IndirectB implements BaseB /* Error */ {}
base class IndirectB2 implements BaseB2 /* Error */ {}
base class IndirectBaseB extends Base implements BaseB /* Error */ {}
base class IndirectBaseB2 extends Base implements BaseB2 /* Error */ {}

View file

@ -0,0 +1,171 @@
library /*isNonNullableByDefault*/;
//
// Problems in library:
//
// pkg/front_end/testcases/class_modifiers/issue52161/main.dart:14:31: Error: The class 'A' can't be implemented outside of its library because it's a base class.
// base class DirectA implements A /* Error */ {}
// ^
//
// pkg/front_end/testcases/class_modifiers/issue52161/main.dart:16:33: Error: The class 'A' can't be implemented outside of its library because it's a base class.
// base class IndirectA implements BaseA /* Error */ {}
// ^
// pkg/front_end/testcases/class_modifiers/issue52161/main_lib1.dart:5:12: Context: The type 'BaseA' is a subtype of 'A', and 'A' is defined here.
// base class A {}
// ^
//
// pkg/front_end/testcases/class_modifiers/issue52161/main.dart:18:50: Error: The class 'A' can't be implemented outside of its library because it's a base class.
// base class IndirectBaseA extends Base implements BaseA /* Error */ {}
// ^
// pkg/front_end/testcases/class_modifiers/issue52161/main_lib1.dart:5:12: Context: The type 'BaseA' is a subtype of 'A', and 'A' is defined here.
// base class A {}
// ^
//
// pkg/front_end/testcases/class_modifiers/issue52161/main.dart:20:34: Error: The class 'A' can't be implemented outside of its library because it's a base class.
// base class IndirectA2 implements BaseA2 /* Error */ {}
// ^
// pkg/front_end/testcases/class_modifiers/issue52161/main_lib1.dart:5:12: Context: The type 'BaseA2' is a subtype of 'A', and 'A' is defined here.
// base class A {}
// ^
//
// pkg/front_end/testcases/class_modifiers/issue52161/main.dart:22:51: Error: The class 'A' can't be implemented outside of its library because it's a base class.
// base class IndirectBaseA2 extends Base implements BaseA2 /* Error */ {}
// ^
// pkg/front_end/testcases/class_modifiers/issue52161/main_lib1.dart:5:12: Context: The type 'BaseA2' is a subtype of 'A', and 'A' is defined here.
// base class A {}
// ^
//
// pkg/front_end/testcases/class_modifiers/issue52161/main.dart:28:31: Error: The class 'B' can't be implemented outside of its library because it's a base class.
// base class DirectB implements B /* Error */ {}
// ^
//
// pkg/front_end/testcases/class_modifiers/issue52161/main.dart:30:33: Error: The class 'B' can't be implemented outside of its library because it's a base class.
// base class IndirectB implements BaseB /* Error */ {}
// ^
// pkg/front_end/testcases/class_modifiers/issue52161/main_lib2.dart:5:12: Context: The type 'BaseB' is a subtype of 'B', and 'B' is defined here.
// base class B {}
// ^
//
// pkg/front_end/testcases/class_modifiers/issue52161/main.dart:32:34: Error: The class 'B' can't be implemented outside of its library because it's a base class.
// base class IndirectB2 implements BaseB2 /* Error */ {}
// ^
// pkg/front_end/testcases/class_modifiers/issue52161/main_lib2.dart:5:12: Context: The type 'BaseB2' is a subtype of 'B', and 'B' is defined here.
// base class B {}
// ^
//
// pkg/front_end/testcases/class_modifiers/issue52161/main.dart:34:50: Error: The class 'B' can't be implemented outside of its library because it's a base class.
// base class IndirectBaseB extends Base implements BaseB /* Error */ {}
// ^
// pkg/front_end/testcases/class_modifiers/issue52161/main_lib2.dart:5:12: Context: The type 'BaseB' is a subtype of 'B', and 'B' is defined here.
// base class B {}
// ^
//
// pkg/front_end/testcases/class_modifiers/issue52161/main.dart:36:51: Error: The class 'B' can't be implemented outside of its library because it's a base class.
// base class IndirectBaseB2 extends Base implements BaseB2 /* Error */ {}
// ^
// pkg/front_end/testcases/class_modifiers/issue52161/main_lib2.dart:5:12: Context: The type 'BaseB2' is a subtype of 'B', and 'B' is defined here.
// base class B {}
// ^
//
import self as self;
import "dart:core" as core;
import "main_lib1.dart" as mai;
import "main_lib2.dart" as mai2;
import "org-dartlang-testcase:///main_lib1.dart";
import "org-dartlang-testcase:///main_lib2.dart";
base class Base extends core::Object {
synthetic constructor •() → self::Base
: super core::Object::•()
;
}
base class BaseA extends mai::A {
synthetic constructor •() → self::BaseA
: super mai::A::•()
;
}
base class BaseA2 extends self::BaseA {
synthetic constructor •() → self::BaseA2
: super self::BaseA::•()
;
}
base class DirectA extends core::Object implements mai::A {
synthetic constructor •() → self::DirectA
: super core::Object::•()
;
}
base class IndirectA extends core::Object implements self::BaseA {
synthetic constructor •() → self::IndirectA
: super core::Object::•()
;
}
base class IndirectBaseA extends self::Base implements self::BaseA {
synthetic constructor •() → self::IndirectBaseA
: super self::Base::•()
;
}
base class IndirectA2 extends core::Object implements self::BaseA2 {
synthetic constructor •() → self::IndirectA2
: super core::Object::•()
;
}
base class IndirectBaseA2 extends self::Base implements self::BaseA2 {
synthetic constructor •() → self::IndirectBaseA2
: super self::Base::•()
;
}
base class BaseB extends mai2::B {
synthetic constructor •() → self::BaseB
: super mai2::B::•()
;
}
base class BaseB2 extends self::BaseB {
synthetic constructor •() → self::BaseB2
: super self::BaseB::•()
;
}
base class DirectB extends core::Object implements mai2::B {
synthetic constructor •() → self::DirectB
: super core::Object::•()
;
}
base class IndirectB extends core::Object implements self::BaseB {
synthetic constructor •() → self::IndirectB
: super core::Object::•()
;
}
base class IndirectB2 extends core::Object implements self::BaseB2 {
synthetic constructor •() → self::IndirectB2
: super core::Object::•()
;
}
base class IndirectBaseB extends self::Base implements self::BaseB {
synthetic constructor •() → self::IndirectBaseB
: super self::Base::•()
;
}
base class IndirectBaseB2 extends self::Base implements self::BaseB2 {
synthetic constructor •() → self::IndirectBaseB2
: super self::Base::•()
;
}
library /*isNonNullableByDefault*/;
import self as mai;
import "dart:core" as core;
base class A extends core::Object {
synthetic constructor •() → mai::A
: super core::Object::•()
;
}
library /*isNonNullableByDefault*/;
import self as mai2;
import "dart:core" as core;
base class B extends core::Object {
synthetic constructor •() → mai2::B
: super core::Object::•()
;
}

View file

@ -0,0 +1,171 @@
library /*isNonNullableByDefault*/;
//
// Problems in library:
//
// pkg/front_end/testcases/class_modifiers/issue52161/main.dart:14:31: Error: The class 'A' can't be implemented outside of its library because it's a base class.
// base class DirectA implements A /* Error */ {}
// ^
//
// pkg/front_end/testcases/class_modifiers/issue52161/main.dart:16:33: Error: The class 'A' can't be implemented outside of its library because it's a base class.
// base class IndirectA implements BaseA /* Error */ {}
// ^
// pkg/front_end/testcases/class_modifiers/issue52161/main_lib1.dart:5:12: Context: The type 'BaseA' is a subtype of 'A', and 'A' is defined here.
// base class A {}
// ^
//
// pkg/front_end/testcases/class_modifiers/issue52161/main.dart:18:50: Error: The class 'A' can't be implemented outside of its library because it's a base class.
// base class IndirectBaseA extends Base implements BaseA /* Error */ {}
// ^
// pkg/front_end/testcases/class_modifiers/issue52161/main_lib1.dart:5:12: Context: The type 'BaseA' is a subtype of 'A', and 'A' is defined here.
// base class A {}
// ^
//
// pkg/front_end/testcases/class_modifiers/issue52161/main.dart:20:34: Error: The class 'A' can't be implemented outside of its library because it's a base class.
// base class IndirectA2 implements BaseA2 /* Error */ {}
// ^
// pkg/front_end/testcases/class_modifiers/issue52161/main_lib1.dart:5:12: Context: The type 'BaseA2' is a subtype of 'A', and 'A' is defined here.
// base class A {}
// ^
//
// pkg/front_end/testcases/class_modifiers/issue52161/main.dart:22:51: Error: The class 'A' can't be implemented outside of its library because it's a base class.
// base class IndirectBaseA2 extends Base implements BaseA2 /* Error */ {}
// ^
// pkg/front_end/testcases/class_modifiers/issue52161/main_lib1.dart:5:12: Context: The type 'BaseA2' is a subtype of 'A', and 'A' is defined here.
// base class A {}
// ^
//
// pkg/front_end/testcases/class_modifiers/issue52161/main.dart:28:31: Error: The class 'B' can't be implemented outside of its library because it's a base class.
// base class DirectB implements B /* Error */ {}
// ^
//
// pkg/front_end/testcases/class_modifiers/issue52161/main.dart:30:33: Error: The class 'B' can't be implemented outside of its library because it's a base class.
// base class IndirectB implements BaseB /* Error */ {}
// ^
// pkg/front_end/testcases/class_modifiers/issue52161/main_lib2.dart:5:12: Context: The type 'BaseB' is a subtype of 'B', and 'B' is defined here.
// base class B {}
// ^
//
// pkg/front_end/testcases/class_modifiers/issue52161/main.dart:32:34: Error: The class 'B' can't be implemented outside of its library because it's a base class.
// base class IndirectB2 implements BaseB2 /* Error */ {}
// ^
// pkg/front_end/testcases/class_modifiers/issue52161/main_lib2.dart:5:12: Context: The type 'BaseB2' is a subtype of 'B', and 'B' is defined here.
// base class B {}
// ^
//
// pkg/front_end/testcases/class_modifiers/issue52161/main.dart:34:50: Error: The class 'B' can't be implemented outside of its library because it's a base class.
// base class IndirectBaseB extends Base implements BaseB /* Error */ {}
// ^
// pkg/front_end/testcases/class_modifiers/issue52161/main_lib2.dart:5:12: Context: The type 'BaseB' is a subtype of 'B', and 'B' is defined here.
// base class B {}
// ^
//
// pkg/front_end/testcases/class_modifiers/issue52161/main.dart:36:51: Error: The class 'B' can't be implemented outside of its library because it's a base class.
// base class IndirectBaseB2 extends Base implements BaseB2 /* Error */ {}
// ^
// pkg/front_end/testcases/class_modifiers/issue52161/main_lib2.dart:5:12: Context: The type 'BaseB2' is a subtype of 'B', and 'B' is defined here.
// base class B {}
// ^
//
import self as self;
import "dart:core" as core;
import "main_lib1.dart" as mai;
import "main_lib2.dart" as mai2;
import "org-dartlang-testcase:///main_lib1.dart";
import "org-dartlang-testcase:///main_lib2.dart";
base class Base extends core::Object {
synthetic constructor •() → self::Base
: super core::Object::•()
;
}
base class BaseA extends mai::A {
synthetic constructor •() → self::BaseA
: super mai::A::•()
;
}
base class BaseA2 extends self::BaseA {
synthetic constructor •() → self::BaseA2
: super self::BaseA::•()
;
}
base class DirectA extends core::Object implements mai::A {
synthetic constructor •() → self::DirectA
: super core::Object::•()
;
}
base class IndirectA extends core::Object implements self::BaseA {
synthetic constructor •() → self::IndirectA
: super core::Object::•()
;
}
base class IndirectBaseA extends self::Base implements self::BaseA {
synthetic constructor •() → self::IndirectBaseA
: super self::Base::•()
;
}
base class IndirectA2 extends core::Object implements self::BaseA2 {
synthetic constructor •() → self::IndirectA2
: super core::Object::•()
;
}
base class IndirectBaseA2 extends self::Base implements self::BaseA2 {
synthetic constructor •() → self::IndirectBaseA2
: super self::Base::•()
;
}
base class BaseB extends mai2::B {
synthetic constructor •() → self::BaseB
: super mai2::B::•()
;
}
base class BaseB2 extends self::BaseB {
synthetic constructor •() → self::BaseB2
: super self::BaseB::•()
;
}
base class DirectB extends core::Object implements mai2::B {
synthetic constructor •() → self::DirectB
: super core::Object::•()
;
}
base class IndirectB extends core::Object implements self::BaseB {
synthetic constructor •() → self::IndirectB
: super core::Object::•()
;
}
base class IndirectB2 extends core::Object implements self::BaseB2 {
synthetic constructor •() → self::IndirectB2
: super core::Object::•()
;
}
base class IndirectBaseB extends self::Base implements self::BaseB {
synthetic constructor •() → self::IndirectBaseB
: super self::Base::•()
;
}
base class IndirectBaseB2 extends self::Base implements self::BaseB2 {
synthetic constructor •() → self::IndirectBaseB2
: super self::Base::•()
;
}
library /*isNonNullableByDefault*/;
import self as mai;
import "dart:core" as core;
base class A extends core::Object {
synthetic constructor •() → mai::A
: super core::Object::•()
;
}
library /*isNonNullableByDefault*/;
import self as mai2;
import "dart:core" as core;
base class B extends core::Object {
synthetic constructor •() → mai2::B
: super core::Object::•()
;
}

View file

@ -0,0 +1,32 @@
import "main_lib1.dart";
import "main_lib2.dart";
base class Base {}
base class BaseA extends A {}
base class BaseA2 extends BaseA {}
base class DirectA implements A {}
base class IndirectA implements BaseA {}
base class IndirectBaseA extends Base implements BaseA {}
base class IndirectA2 implements BaseA2 {}
base class IndirectBaseA2 extends Base implements BaseA2 {}
base class BaseB extends B {}
base class BaseB2 extends BaseB {}
base class DirectB implements B {}
base class IndirectB implements BaseB {}
base class IndirectB2 implements BaseB2 {}
base class IndirectBaseB extends Base implements BaseB {}
base class IndirectBaseB2 extends Base implements BaseB2 {}

View file

@ -0,0 +1,32 @@
import "main_lib1.dart";
import "main_lib2.dart";
base class Base {}
base class BaseA extends A {}
base class BaseA2 extends BaseA {}
base class BaseB extends B {}
base class BaseB2 extends BaseB {}
base class DirectA implements A {}
base class DirectB implements B {}
base class IndirectA implements BaseA {}
base class IndirectA2 implements BaseA2 {}
base class IndirectB implements BaseB {}
base class IndirectB2 implements BaseB2 {}
base class IndirectBaseA extends Base implements BaseA {}
base class IndirectBaseA2 extends Base implements BaseA2 {}
base class IndirectBaseB extends Base implements BaseB {}
base class IndirectBaseB2 extends Base implements BaseB2 {}

View file

@ -0,0 +1,171 @@
library /*isNonNullableByDefault*/;
//
// Problems in library:
//
// pkg/front_end/testcases/class_modifiers/issue52161/main.dart:14:31: Error: The class 'A' can't be implemented outside of its library because it's a base class.
// base class DirectA implements A /* Error */ {}
// ^
//
// pkg/front_end/testcases/class_modifiers/issue52161/main.dart:16:33: Error: The class 'A' can't be implemented outside of its library because it's a base class.
// base class IndirectA implements BaseA /* Error */ {}
// ^
// pkg/front_end/testcases/class_modifiers/issue52161/main_lib1.dart:5:12: Context: The type 'BaseA' is a subtype of 'A', and 'A' is defined here.
// base class A {}
// ^
//
// pkg/front_end/testcases/class_modifiers/issue52161/main.dart:18:50: Error: The class 'A' can't be implemented outside of its library because it's a base class.
// base class IndirectBaseA extends Base implements BaseA /* Error */ {}
// ^
// pkg/front_end/testcases/class_modifiers/issue52161/main_lib1.dart:5:12: Context: The type 'BaseA' is a subtype of 'A', and 'A' is defined here.
// base class A {}
// ^
//
// pkg/front_end/testcases/class_modifiers/issue52161/main.dart:20:34: Error: The class 'A' can't be implemented outside of its library because it's a base class.
// base class IndirectA2 implements BaseA2 /* Error */ {}
// ^
// pkg/front_end/testcases/class_modifiers/issue52161/main_lib1.dart:5:12: Context: The type 'BaseA2' is a subtype of 'A', and 'A' is defined here.
// base class A {}
// ^
//
// pkg/front_end/testcases/class_modifiers/issue52161/main.dart:22:51: Error: The class 'A' can't be implemented outside of its library because it's a base class.
// base class IndirectBaseA2 extends Base implements BaseA2 /* Error */ {}
// ^
// pkg/front_end/testcases/class_modifiers/issue52161/main_lib1.dart:5:12: Context: The type 'BaseA2' is a subtype of 'A', and 'A' is defined here.
// base class A {}
// ^
//
// pkg/front_end/testcases/class_modifiers/issue52161/main.dart:28:31: Error: The class 'B' can't be implemented outside of its library because it's a base class.
// base class DirectB implements B /* Error */ {}
// ^
//
// pkg/front_end/testcases/class_modifiers/issue52161/main.dart:30:33: Error: The class 'B' can't be implemented outside of its library because it's a base class.
// base class IndirectB implements BaseB /* Error */ {}
// ^
// pkg/front_end/testcases/class_modifiers/issue52161/main_lib2.dart:5:12: Context: The type 'BaseB' is a subtype of 'B', and 'B' is defined here.
// base class B {}
// ^
//
// pkg/front_end/testcases/class_modifiers/issue52161/main.dart:32:34: Error: The class 'B' can't be implemented outside of its library because it's a base class.
// base class IndirectB2 implements BaseB2 /* Error */ {}
// ^
// pkg/front_end/testcases/class_modifiers/issue52161/main_lib2.dart:5:12: Context: The type 'BaseB2' is a subtype of 'B', and 'B' is defined here.
// base class B {}
// ^
//
// pkg/front_end/testcases/class_modifiers/issue52161/main.dart:34:50: Error: The class 'B' can't be implemented outside of its library because it's a base class.
// base class IndirectBaseB extends Base implements BaseB /* Error */ {}
// ^
// pkg/front_end/testcases/class_modifiers/issue52161/main_lib2.dart:5:12: Context: The type 'BaseB' is a subtype of 'B', and 'B' is defined here.
// base class B {}
// ^
//
// pkg/front_end/testcases/class_modifiers/issue52161/main.dart:36:51: Error: The class 'B' can't be implemented outside of its library because it's a base class.
// base class IndirectBaseB2 extends Base implements BaseB2 /* Error */ {}
// ^
// pkg/front_end/testcases/class_modifiers/issue52161/main_lib2.dart:5:12: Context: The type 'BaseB2' is a subtype of 'B', and 'B' is defined here.
// base class B {}
// ^
//
import self as self;
import "dart:core" as core;
import "main_lib1.dart" as mai;
import "main_lib2.dart" as mai2;
import "org-dartlang-testcase:///main_lib1.dart";
import "org-dartlang-testcase:///main_lib2.dart";
base class Base extends core::Object {
synthetic constructor •() → self::Base
: super core::Object::•()
;
}
base class BaseA extends mai::A {
synthetic constructor •() → self::BaseA
: super mai::A::•()
;
}
base class BaseA2 extends self::BaseA {
synthetic constructor •() → self::BaseA2
: super self::BaseA::•()
;
}
base class DirectA extends core::Object implements mai::A {
synthetic constructor •() → self::DirectA
: super core::Object::•()
;
}
base class IndirectA extends core::Object implements self::BaseA {
synthetic constructor •() → self::IndirectA
: super core::Object::•()
;
}
base class IndirectBaseA extends self::Base implements self::BaseA {
synthetic constructor •() → self::IndirectBaseA
: super self::Base::•()
;
}
base class IndirectA2 extends core::Object implements self::BaseA2 {
synthetic constructor •() → self::IndirectA2
: super core::Object::•()
;
}
base class IndirectBaseA2 extends self::Base implements self::BaseA2 {
synthetic constructor •() → self::IndirectBaseA2
: super self::Base::•()
;
}
base class BaseB extends mai2::B {
synthetic constructor •() → self::BaseB
: super mai2::B::•()
;
}
base class BaseB2 extends self::BaseB {
synthetic constructor •() → self::BaseB2
: super self::BaseB::•()
;
}
base class DirectB extends core::Object implements mai2::B {
synthetic constructor •() → self::DirectB
: super core::Object::•()
;
}
base class IndirectB extends core::Object implements self::BaseB {
synthetic constructor •() → self::IndirectB
: super core::Object::•()
;
}
base class IndirectB2 extends core::Object implements self::BaseB2 {
synthetic constructor •() → self::IndirectB2
: super core::Object::•()
;
}
base class IndirectBaseB extends self::Base implements self::BaseB {
synthetic constructor •() → self::IndirectBaseB
: super self::Base::•()
;
}
base class IndirectBaseB2 extends self::Base implements self::BaseB2 {
synthetic constructor •() → self::IndirectBaseB2
: super self::Base::•()
;
}
library /*isNonNullableByDefault*/;
import self as mai;
import "dart:core" as core;
base class A extends core::Object {
synthetic constructor •() → mai::A
: super core::Object::•()
;
}
library /*isNonNullableByDefault*/;
import self as mai2;
import "dart:core" as core;
base class B extends core::Object {
synthetic constructor •() → mai2::B
: super core::Object::•()
;
}

View file

@ -0,0 +1,161 @@
library /*isNonNullableByDefault*/;
//
// Problems in library:
//
// pkg/front_end/testcases/class_modifiers/issue52161/main.dart:14:31: Error: The class 'A' can't be implemented outside of its library because it's a base class.
// base class DirectA implements A /* Error */ {}
// ^
//
// pkg/front_end/testcases/class_modifiers/issue52161/main.dart:16:33: Error: The class 'A' can't be implemented outside of its library because it's a base class.
// base class IndirectA implements BaseA /* Error */ {}
// ^
// pkg/front_end/testcases/class_modifiers/issue52161/main_lib1.dart:5:12: Context: The type 'BaseA' is a subtype of 'A', and 'A' is defined here.
// base class A {}
// ^
//
// pkg/front_end/testcases/class_modifiers/issue52161/main.dart:18:50: Error: The class 'A' can't be implemented outside of its library because it's a base class.
// base class IndirectBaseA extends Base implements BaseA /* Error */ {}
// ^
// pkg/front_end/testcases/class_modifiers/issue52161/main_lib1.dart:5:12: Context: The type 'BaseA' is a subtype of 'A', and 'A' is defined here.
// base class A {}
// ^
//
// pkg/front_end/testcases/class_modifiers/issue52161/main.dart:20:34: Error: The class 'A' can't be implemented outside of its library because it's a base class.
// base class IndirectA2 implements BaseA2 /* Error */ {}
// ^
// pkg/front_end/testcases/class_modifiers/issue52161/main_lib1.dart:5:12: Context: The type 'BaseA2' is a subtype of 'A', and 'A' is defined here.
// base class A {}
// ^
//
// pkg/front_end/testcases/class_modifiers/issue52161/main.dart:22:51: Error: The class 'A' can't be implemented outside of its library because it's a base class.
// base class IndirectBaseA2 extends Base implements BaseA2 /* Error */ {}
// ^
// pkg/front_end/testcases/class_modifiers/issue52161/main_lib1.dart:5:12: Context: The type 'BaseA2' is a subtype of 'A', and 'A' is defined here.
// base class A {}
// ^
//
// pkg/front_end/testcases/class_modifiers/issue52161/main.dart:28:31: Error: The class 'B' can't be implemented outside of its library because it's a base class.
// base class DirectB implements B /* Error */ {}
// ^
//
// pkg/front_end/testcases/class_modifiers/issue52161/main.dart:30:33: Error: The class 'B' can't be implemented outside of its library because it's a base class.
// base class IndirectB implements BaseB /* Error */ {}
// ^
// pkg/front_end/testcases/class_modifiers/issue52161/main_lib2.dart:5:12: Context: The type 'BaseB' is a subtype of 'B', and 'B' is defined here.
// base class B {}
// ^
//
// pkg/front_end/testcases/class_modifiers/issue52161/main.dart:32:34: Error: The class 'B' can't be implemented outside of its library because it's a base class.
// base class IndirectB2 implements BaseB2 /* Error */ {}
// ^
// pkg/front_end/testcases/class_modifiers/issue52161/main_lib2.dart:5:12: Context: The type 'BaseB2' is a subtype of 'B', and 'B' is defined here.
// base class B {}
// ^
//
// pkg/front_end/testcases/class_modifiers/issue52161/main.dart:34:50: Error: The class 'B' can't be implemented outside of its library because it's a base class.
// base class IndirectBaseB extends Base implements BaseB /* Error */ {}
// ^
// pkg/front_end/testcases/class_modifiers/issue52161/main_lib2.dart:5:12: Context: The type 'BaseB' is a subtype of 'B', and 'B' is defined here.
// base class B {}
// ^
//
// pkg/front_end/testcases/class_modifiers/issue52161/main.dart:36:51: Error: The class 'B' can't be implemented outside of its library because it's a base class.
// base class IndirectBaseB2 extends Base implements BaseB2 /* Error */ {}
// ^
// pkg/front_end/testcases/class_modifiers/issue52161/main_lib2.dart:5:12: Context: The type 'BaseB2' is a subtype of 'B', and 'B' is defined here.
// base class B {}
// ^
//
import self as self;
import "dart:core" as core;
import "main_lib1.dart" as mai;
import "main_lib2.dart" as mai2;
import "org-dartlang-testcase:///main_lib1.dart";
import "org-dartlang-testcase:///main_lib2.dart";
base class Base extends core::Object {
synthetic constructor •() → self::Base
: super core::Object::•()
;
}
base class BaseA extends mai::A {
synthetic constructor •() → self::BaseA
: super mai::A::•()
;
}
base class BaseA2 extends self::BaseA {
synthetic constructor •() → self::BaseA2
: super self::BaseA::•()
;
}
base class DirectA extends core::Object implements mai::A {
synthetic constructor •() → self::DirectA
: super core::Object::•()
;
}
base class IndirectA extends core::Object implements self::BaseA {
synthetic constructor •() → self::IndirectA
: super core::Object::•()
;
}
base class IndirectBaseA extends self::Base implements self::BaseA {
synthetic constructor •() → self::IndirectBaseA
: super self::Base::•()
;
}
base class IndirectA2 extends core::Object implements self::BaseA2 {
synthetic constructor •() → self::IndirectA2
: super core::Object::•()
;
}
base class IndirectBaseA2 extends self::Base implements self::BaseA2 {
synthetic constructor •() → self::IndirectBaseA2
: super self::Base::•()
;
}
base class BaseB extends mai2::B {
synthetic constructor •() → self::BaseB
: super mai2::B::•()
;
}
base class BaseB2 extends self::BaseB {
synthetic constructor •() → self::BaseB2
: super self::BaseB::•()
;
}
base class DirectB extends core::Object implements mai2::B {
synthetic constructor •() → self::DirectB
: super core::Object::•()
;
}
base class IndirectB extends core::Object implements self::BaseB {
synthetic constructor •() → self::IndirectB
: super core::Object::•()
;
}
base class IndirectB2 extends core::Object implements self::BaseB2 {
synthetic constructor •() → self::IndirectB2
: super core::Object::•()
;
}
base class IndirectBaseB extends self::Base implements self::BaseB {
synthetic constructor •() → self::IndirectBaseB
: super self::Base::•()
;
}
base class IndirectBaseB2 extends self::Base implements self::BaseB2 {
synthetic constructor •() → self::IndirectBaseB2
: super self::Base::•()
;
}
library /*isNonNullableByDefault*/;
import self as mai;
import "dart:core" as core;
base class A extends core::Object {
synthetic constructor •() → mai::A
: super core::Object::•()
;
}

View file

@ -0,0 +1,154 @@
library /*isNonNullableByDefault*/;
//
// Problems in library:
//
// pkg/front_end/testcases/class_modifiers/issue52161/main.dart:14:31: Error: The class 'A' can't be implemented outside of its library because it's a base class.
// base class DirectA implements A /* Error */ {}
// ^
//
// pkg/front_end/testcases/class_modifiers/issue52161/main.dart:16:33: Error: The class 'A' can't be implemented outside of its library because it's a base class.
// base class IndirectA implements BaseA /* Error */ {}
// ^
// pkg/front_end/testcases/class_modifiers/issue52161/main_lib1.dart:5:12: Context: The type 'BaseA' is a subtype of 'A', and 'A' is defined here.
// base class A {}
// ^
//
// pkg/front_end/testcases/class_modifiers/issue52161/main.dart:18:50: Error: The class 'A' can't be implemented outside of its library because it's a base class.
// base class IndirectBaseA extends Base implements BaseA /* Error */ {}
// ^
// pkg/front_end/testcases/class_modifiers/issue52161/main_lib1.dart:5:12: Context: The type 'BaseA' is a subtype of 'A', and 'A' is defined here.
// base class A {}
// ^
//
// pkg/front_end/testcases/class_modifiers/issue52161/main.dart:20:34: Error: The class 'A' can't be implemented outside of its library because it's a base class.
// base class IndirectA2 implements BaseA2 /* Error */ {}
// ^
// pkg/front_end/testcases/class_modifiers/issue52161/main_lib1.dart:5:12: Context: The type 'BaseA2' is a subtype of 'A', and 'A' is defined here.
// base class A {}
// ^
//
// pkg/front_end/testcases/class_modifiers/issue52161/main.dart:22:51: Error: The class 'A' can't be implemented outside of its library because it's a base class.
// base class IndirectBaseA2 extends Base implements BaseA2 /* Error */ {}
// ^
// pkg/front_end/testcases/class_modifiers/issue52161/main_lib1.dart:5:12: Context: The type 'BaseA2' is a subtype of 'A', and 'A' is defined here.
// base class A {}
// ^
//
// pkg/front_end/testcases/class_modifiers/issue52161/main.dart:28:31: Error: The class 'B' can't be implemented outside of its library because it's a base class.
// base class DirectB implements B /* Error */ {}
// ^
//
// pkg/front_end/testcases/class_modifiers/issue52161/main.dart:30:33: Error: The class 'B' can't be implemented outside of its library because it's a base class.
// base class IndirectB implements BaseB /* Error */ {}
// ^
// pkg/front_end/testcases/class_modifiers/issue52161/main_lib2.dart:5:12: Context: The type 'BaseB' is a subtype of 'B', and 'B' is defined here.
// base class B {}
// ^
//
// pkg/front_end/testcases/class_modifiers/issue52161/main.dart:32:34: Error: The class 'B' can't be implemented outside of its library because it's a base class.
// base class IndirectB2 implements BaseB2 /* Error */ {}
// ^
// pkg/front_end/testcases/class_modifiers/issue52161/main_lib2.dart:5:12: Context: The type 'BaseB2' is a subtype of 'B', and 'B' is defined here.
// base class B {}
// ^
//
// pkg/front_end/testcases/class_modifiers/issue52161/main.dart:34:50: Error: The class 'B' can't be implemented outside of its library because it's a base class.
// base class IndirectBaseB extends Base implements BaseB /* Error */ {}
// ^
// pkg/front_end/testcases/class_modifiers/issue52161/main_lib2.dart:5:12: Context: The type 'BaseB' is a subtype of 'B', and 'B' is defined here.
// base class B {}
// ^
//
// pkg/front_end/testcases/class_modifiers/issue52161/main.dart:36:51: Error: The class 'B' can't be implemented outside of its library because it's a base class.
// base class IndirectBaseB2 extends Base implements BaseB2 /* Error */ {}
// ^
// pkg/front_end/testcases/class_modifiers/issue52161/main_lib2.dart:5:12: Context: The type 'BaseB2' is a subtype of 'B', and 'B' is defined here.
// base class B {}
// ^
//
import self as self;
import "dart:core" as core;
import "main_lib1.dart" as mai;
import "main_lib2.dart" as mai2;
import "org-dartlang-testcase:///main_lib1.dart";
import "org-dartlang-testcase:///main_lib2.dart";
base class Base extends core::Object {
synthetic constructor •() → self::Base
;
}
base class BaseA extends mai::A {
synthetic constructor •() → self::BaseA
;
}
base class BaseA2 extends self::BaseA {
synthetic constructor •() → self::BaseA2
;
}
base class DirectA extends core::Object implements mai::A {
synthetic constructor •() → self::DirectA
;
}
base class IndirectA extends core::Object implements self::BaseA {
synthetic constructor •() → self::IndirectA
;
}
base class IndirectBaseA extends self::Base implements self::BaseA {
synthetic constructor •() → self::IndirectBaseA
;
}
base class IndirectA2 extends core::Object implements self::BaseA2 {
synthetic constructor •() → self::IndirectA2
;
}
base class IndirectBaseA2 extends self::Base implements self::BaseA2 {
synthetic constructor •() → self::IndirectBaseA2
;
}
base class BaseB extends mai2::B {
synthetic constructor •() → self::BaseB
;
}
base class BaseB2 extends self::BaseB {
synthetic constructor •() → self::BaseB2
;
}
base class DirectB extends core::Object implements mai2::B {
synthetic constructor •() → self::DirectB
;
}
base class IndirectB extends core::Object implements self::BaseB {
synthetic constructor •() → self::IndirectB
;
}
base class IndirectB2 extends core::Object implements self::BaseB2 {
synthetic constructor •() → self::IndirectB2
;
}
base class IndirectBaseB extends self::Base implements self::BaseB {
synthetic constructor •() → self::IndirectBaseB
;
}
base class IndirectBaseB2 extends self::Base implements self::BaseB2 {
synthetic constructor •() → self::IndirectBaseB2
;
}
library /*isNonNullableByDefault*/;
import self as mai;
import "dart:core" as core;
base class A extends core::Object {
synthetic constructor •() → mai::A
;
}
library /*isNonNullableByDefault*/;
import self as mai2;
import "dart:core" as core;
base class B extends core::Object {
synthetic constructor •() → mai2::B
;
}

View file

@ -0,0 +1,171 @@
library /*isNonNullableByDefault*/;
//
// Problems in library:
//
// pkg/front_end/testcases/class_modifiers/issue52161/main.dart:14:31: Error: The class 'A' can't be implemented outside of its library because it's a base class.
// base class DirectA implements A /* Error */ {}
// ^
//
// pkg/front_end/testcases/class_modifiers/issue52161/main.dart:16:33: Error: The class 'A' can't be implemented outside of its library because it's a base class.
// base class IndirectA implements BaseA /* Error */ {}
// ^
// pkg/front_end/testcases/class_modifiers/issue52161/main_lib1.dart:5:12: Context: The type 'BaseA' is a subtype of 'A', and 'A' is defined here.
// base class A {}
// ^
//
// pkg/front_end/testcases/class_modifiers/issue52161/main.dart:18:50: Error: The class 'A' can't be implemented outside of its library because it's a base class.
// base class IndirectBaseA extends Base implements BaseA /* Error */ {}
// ^
// pkg/front_end/testcases/class_modifiers/issue52161/main_lib1.dart:5:12: Context: The type 'BaseA' is a subtype of 'A', and 'A' is defined here.
// base class A {}
// ^
//
// pkg/front_end/testcases/class_modifiers/issue52161/main.dart:20:34: Error: The class 'A' can't be implemented outside of its library because it's a base class.
// base class IndirectA2 implements BaseA2 /* Error */ {}
// ^
// pkg/front_end/testcases/class_modifiers/issue52161/main_lib1.dart:5:12: Context: The type 'BaseA2' is a subtype of 'A', and 'A' is defined here.
// base class A {}
// ^
//
// pkg/front_end/testcases/class_modifiers/issue52161/main.dart:22:51: Error: The class 'A' can't be implemented outside of its library because it's a base class.
// base class IndirectBaseA2 extends Base implements BaseA2 /* Error */ {}
// ^
// pkg/front_end/testcases/class_modifiers/issue52161/main_lib1.dart:5:12: Context: The type 'BaseA2' is a subtype of 'A', and 'A' is defined here.
// base class A {}
// ^
//
// pkg/front_end/testcases/class_modifiers/issue52161/main.dart:28:31: Error: The class 'B' can't be implemented outside of its library because it's a base class.
// base class DirectB implements B /* Error */ {}
// ^
//
// pkg/front_end/testcases/class_modifiers/issue52161/main.dart:30:33: Error: The class 'B' can't be implemented outside of its library because it's a base class.
// base class IndirectB implements BaseB /* Error */ {}
// ^
// pkg/front_end/testcases/class_modifiers/issue52161/main_lib2.dart:5:12: Context: The type 'BaseB' is a subtype of 'B', and 'B' is defined here.
// base class B {}
// ^
//
// pkg/front_end/testcases/class_modifiers/issue52161/main.dart:32:34: Error: The class 'B' can't be implemented outside of its library because it's a base class.
// base class IndirectB2 implements BaseB2 /* Error */ {}
// ^
// pkg/front_end/testcases/class_modifiers/issue52161/main_lib2.dart:5:12: Context: The type 'BaseB2' is a subtype of 'B', and 'B' is defined here.
// base class B {}
// ^
//
// pkg/front_end/testcases/class_modifiers/issue52161/main.dart:34:50: Error: The class 'B' can't be implemented outside of its library because it's a base class.
// base class IndirectBaseB extends Base implements BaseB /* Error */ {}
// ^
// pkg/front_end/testcases/class_modifiers/issue52161/main_lib2.dart:5:12: Context: The type 'BaseB' is a subtype of 'B', and 'B' is defined here.
// base class B {}
// ^
//
// pkg/front_end/testcases/class_modifiers/issue52161/main.dart:36:51: Error: The class 'B' can't be implemented outside of its library because it's a base class.
// base class IndirectBaseB2 extends Base implements BaseB2 /* Error */ {}
// ^
// pkg/front_end/testcases/class_modifiers/issue52161/main_lib2.dart:5:12: Context: The type 'BaseB2' is a subtype of 'B', and 'B' is defined here.
// base class B {}
// ^
//
import self as self;
import "dart:core" as core;
import "main_lib1.dart" as mai;
import "main_lib2.dart" as mai2;
import "org-dartlang-testcase:///main_lib1.dart";
import "org-dartlang-testcase:///main_lib2.dart";
base class Base extends core::Object {
synthetic constructor •() → self::Base
: super core::Object::•()
;
}
base class BaseA extends mai::A {
synthetic constructor •() → self::BaseA
: super mai::A::•()
;
}
base class BaseA2 extends self::BaseA {
synthetic constructor •() → self::BaseA2
: super self::BaseA::•()
;
}
base class DirectA extends core::Object implements mai::A {
synthetic constructor •() → self::DirectA
: super core::Object::•()
;
}
base class IndirectA extends core::Object implements self::BaseA {
synthetic constructor •() → self::IndirectA
: super core::Object::•()
;
}
base class IndirectBaseA extends self::Base implements self::BaseA {
synthetic constructor •() → self::IndirectBaseA
: super self::Base::•()
;
}
base class IndirectA2 extends core::Object implements self::BaseA2 {
synthetic constructor •() → self::IndirectA2
: super core::Object::•()
;
}
base class IndirectBaseA2 extends self::Base implements self::BaseA2 {
synthetic constructor •() → self::IndirectBaseA2
: super self::Base::•()
;
}
base class BaseB extends mai2::B {
synthetic constructor •() → self::BaseB
: super mai2::B::•()
;
}
base class BaseB2 extends self::BaseB {
synthetic constructor •() → self::BaseB2
: super self::BaseB::•()
;
}
base class DirectB extends core::Object implements mai2::B {
synthetic constructor •() → self::DirectB
: super core::Object::•()
;
}
base class IndirectB extends core::Object implements self::BaseB {
synthetic constructor •() → self::IndirectB
: super core::Object::•()
;
}
base class IndirectB2 extends core::Object implements self::BaseB2 {
synthetic constructor •() → self::IndirectB2
: super core::Object::•()
;
}
base class IndirectBaseB extends self::Base implements self::BaseB {
synthetic constructor •() → self::IndirectBaseB
: super self::Base::•()
;
}
base class IndirectBaseB2 extends self::Base implements self::BaseB2 {
synthetic constructor •() → self::IndirectBaseB2
: super self::Base::•()
;
}
library /*isNonNullableByDefault*/;
import self as mai;
import "dart:core" as core;
base class A extends core::Object {
synthetic constructor •() → mai::A
: super core::Object::•()
;
}
library /*isNonNullableByDefault*/;
import self as mai2;
import "dart:core" as core;
base class B extends core::Object {
synthetic constructor •() → mai2::B
: super core::Object::•()
;
}

View file

@ -0,0 +1,5 @@
// Copyright (c) 2023, 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.
base class A {}

View file

@ -0,0 +1,5 @@
// Copyright (c) 2023, 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.
base class B {}

View file

@ -0,0 +1 @@
main_lib2.dart

View file

@ -300,39 +300,39 @@ sealed class SealedMixinApply extends Object with BaseMixin {}
class SimpleSealedMixinApplyImplement implements SealedMixinApply {}
// ^^^^^^^^^^^^^^^^
// [analyzer] COMPILE_TIME_ERROR.INVALID_USE_OF_TYPE_OUTSIDE_LIBRARY
// [cfe] The class 'BaseMixin' can't be implemented outside of its library because it's a base class.
// [cfe] The mixin 'BaseMixin' can't be implemented outside of its library because it's a base mixin.
base class BaseSealedMixinApplyImplement implements SealedMixinApply {}
// ^^^^^^^^^^^^^^^^
// [analyzer] COMPILE_TIME_ERROR.INVALID_USE_OF_TYPE_OUTSIDE_LIBRARY
// [cfe] The class 'BaseMixin' can't be implemented outside of its library because it's a base class.
// [cfe] The mixin 'BaseMixin' can't be implemented outside of its library because it's a base mixin.
interface class InterfaceSealedMixinApplyImplement
implements SealedMixinApply {}
// ^^^^^^^^^^^^^^^^
// [analyzer] COMPILE_TIME_ERROR.INVALID_USE_OF_TYPE_OUTSIDE_LIBRARY
// [cfe] The class 'BaseMixin' can't be implemented outside of its library because it's a base class.
// [cfe] The mixin 'BaseMixin' can't be implemented outside of its library because it's a base mixin.
final class FinalSealedMixinApplyImplement implements SealedMixinApply {}
// ^^^^^^^^^^^^^^^^
// [analyzer] COMPILE_TIME_ERROR.INVALID_USE_OF_TYPE_OUTSIDE_LIBRARY
// [cfe] The class 'BaseMixin' can't be implemented outside of its library because it's a base class.
// [cfe] The mixin 'BaseMixin' can't be implemented outside of its library because it's a base mixin.
sealed class SealedSealedMixinApplyImplement implements SealedMixinApply {}
// ^^^^^^^^^^^^^^^^
// [analyzer] COMPILE_TIME_ERROR.INVALID_USE_OF_TYPE_OUTSIDE_LIBRARY
// [cfe] The class 'BaseMixin' can't be implemented outside of its library because it's a base class.
// [cfe] The mixin 'BaseMixin' can't be implemented outside of its library because it's a base mixin.
base mixin class BaseMixinClassSealedMixinApplyImplement
implements SealedMixinApply {}
// ^^^^^^^^^^^^^^^^
// [analyzer] COMPILE_TIME_ERROR.INVALID_USE_OF_TYPE_OUTSIDE_LIBRARY
// [cfe] The class 'BaseMixin' can't be implemented outside of its library because it's a base class.
// [cfe] The mixin 'BaseMixin' can't be implemented outside of its library because it's a base mixin.
base mixin BaseMixinSealedMixinApplyImplement implements SealedMixinApply {}
// ^^^^^^^^^^^^^^^^
// [analyzer] COMPILE_TIME_ERROR.INVALID_USE_OF_TYPE_OUTSIDE_LIBRARY
// [cfe] The class 'BaseMixin' can't be implemented outside of its library because it's a base class.
// [cfe] The mixin 'BaseMixin' can't be implemented outside of its library because it's a base mixin.
/// It is an error to use BaseMixin as a mixin application, if the result
/// is not base, final or sealed.
@ -388,40 +388,40 @@ sealed class SealedMixinApplication = Object with BaseMixin;
class SimpleSealedMixinApplicationImplement implements SealedMixinApplication {}
// ^^^^^^^^^^^^^^^^^^^^^^
// [analyzer] COMPILE_TIME_ERROR.INVALID_USE_OF_TYPE_OUTSIDE_LIBRARY
// [cfe] The class 'BaseMixin' can't be implemented outside of its library because it's a base class.
// [cfe] The mixin 'BaseMixin' can't be implemented outside of its library because it's a base mixin.
base class BaseSealedMixinApplicationImplement
implements SealedMixinApplication {}
// ^^^^^^^^^^^^^^^^^^^^^^
// [analyzer] COMPILE_TIME_ERROR.INVALID_USE_OF_TYPE_OUTSIDE_LIBRARY
// [cfe] The class 'BaseMixin' can't be implemented outside of its library because it's a base class.
// [cfe] The mixin 'BaseMixin' can't be implemented outside of its library because it's a base mixin.
interface class InterfaceSealedMixinApplicationImplement
implements SealedMixinApplication {}
// ^^^^^^^^^^^^^^^^^^^^^^
// [analyzer] COMPILE_TIME_ERROR.INVALID_USE_OF_TYPE_OUTSIDE_LIBRARY
// [cfe] The class 'BaseMixin' can't be implemented outside of its library because it's a base class.
// [cfe] The mixin 'BaseMixin' can't be implemented outside of its library because it's a base mixin.
final class FinalSealedMixinApplicationImplement
implements SealedMixinApplication {}
// ^^^^^^^^^^^^^^^^^^^^^^
// [analyzer] COMPILE_TIME_ERROR.INVALID_USE_OF_TYPE_OUTSIDE_LIBRARY
// [cfe] The class 'BaseMixin' can't be implemented outside of its library because it's a base class.
// [cfe] The mixin 'BaseMixin' can't be implemented outside of its library because it's a base mixin.
sealed class SealedSealedMixinApplicationImplement
implements SealedMixinApplication {}
// ^^^^^^^^^^^^^^^^^^^^^^
// [analyzer] COMPILE_TIME_ERROR.INVALID_USE_OF_TYPE_OUTSIDE_LIBRARY
// [cfe] The class 'BaseMixin' can't be implemented outside of its library because it's a base class.
// [cfe] The mixin 'BaseMixin' can't be implemented outside of its library because it's a base mixin.
base mixin class BaseMixinClassSealedMixinApplicationImplement
implements SealedMixinApplication {}
// ^^^^^^^^^^^^^^^^^^^^^^
// [analyzer] COMPILE_TIME_ERROR.INVALID_USE_OF_TYPE_OUTSIDE_LIBRARY
// [cfe] The class 'BaseMixin' can't be implemented outside of its library because it's a base class.
// [cfe] The mixin 'BaseMixin' can't be implemented outside of its library because it's a base mixin.
base mixin BaseMixinSealedMixinApplicationImplement
implements SealedMixinApplication {}
// ^^^^^^^^^^^^^^^^^^^^^^
// [analyzer] COMPILE_TIME_ERROR.INVALID_USE_OF_TYPE_OUTSIDE_LIBRARY
// [cfe] The class 'BaseMixin' can't be implemented outside of its library because it's a base class.
// [cfe] The mixin 'BaseMixin' can't be implemented outside of its library because it's a base mixin.