Files
sdk/pkg/_fe_analyzer_shared/test/inheritance/data/function.dart
T
Kallen Tu ea21df9dbe [cfe] Disallow implementing a legacy library subclass of a final/base class in the core libraries.
This behaviour should only happen when a post-feature library implements
a pre-feature library declaration that has a final/base core library class as a super declaration.

Bug: https://github.com/dart-lang/sdk/issues/52115
Change-Id: If42129ba3ba7e337cc6ffc21604c6d0f2976344c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/301503
Reviewed-by: Nate Bosch <nbosch@google.com>
Commit-Queue: Kallen Tu <kallentu@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2023-05-10 14:31:50 +00:00

30 lines
1.3 KiB
Dart

// Copyright (c) 2020, 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.
/*library: nnbd=true*/
/*class: A:A,Object*/
class A
implements /*analyzer.error: CompileTimeErrorCode.FINAL_CLASS_IMPLEMENTED_OUTSIDE_OF_LIBRARY*/
/*cfe|cfe:builder.error: FinalClassImplementedOutsideOfLibrary*/ Function {}
/*class: B:B,Object*/
class B
extends /*analyzer.error: CompileTimeErrorCode.FINAL_CLASS_EXTENDED_OUTSIDE_OF_LIBRARY*/ /*cfe|cfe:builder.error: FinalClassExtendedOutsideOfLibrary*/ Function {}
/*cfe|cfe:builder.class: C:C,Object,_C&Object&Function*/
/*analyzer.class: C:C,Object*/
/*cfe|cfe:builder.class: _C&Object&Function:Object,_C&Object&Function*/
class /*cfe|cfe:builder.error: SubtypeOfFinalIsNotBaseFinalOrSealed*/ C
extends Object
with /*analyzer.error: CompileTimeErrorCode.CLASS_USED_AS_MIXIN*/
/*cfe|cfe:builder.error: CantUseClassAsMixin*/ Function {}
// CFE hides that this is a mixin declaration since its mixed in type has been
// removed.
/*cfe|cfe:builder.class: D:D,Object*/
class D = Object
with /*analyzer.error: CompileTimeErrorCode.CLASS_USED_AS_MIXIN*/ /*cfe|cfe:builder.error: CantUseClassAsMixin*/
Function;