You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[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: #52115
Change-Id: If42129ba3ba7e337cc6ffc21604c6d0f2976344c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/301503
Reviewed-by: Nate Bosch <[email protected]>
Commit-Queue: Kallen Tu <[email protected]>
Reviewed-by: Johnni Winther <[email protected]>
// pkg/front_end/testcases/class_modifiers/issue52115/main.dart:10:16: Error: The class 'LinkedList' can't be implemented outside of its library because it's a base class.
6
+
// implements LegacyImplementBaseCore<E> {}
7
+
// ^
8
+
// sdk/lib/collection/linked_list.dart:81:12: Context: The type 'LegacyImplementBaseCore' is a subtype of 'LinkedList', and 'LinkedList' is defined here.
9
+
// base class LinkedList<E extends LinkedListEntry<E>> extends Iterable<E> {
10
+
// ^
11
+
//
12
+
// pkg/front_end/testcases/class_modifiers/issue52115/main.dart:13:45: Error: The class 'MapEntry' can't be implemented outside of its library because it's a final class.
13
+
// final class LegacyImplementFinal implements LegacyImplementFinalCore {
14
+
// ^
15
+
// sdk/lib/core/map.dart:472:13: Context: The type 'LegacyImplementFinalCore' is a subtype of 'MapEntry', and 'MapEntry' is defined here.
16
+
// final class MapEntry<K, V> {
17
+
// ^
18
+
//
19
+
import self as self;
20
+
import "dart:collection" as col;
21
+
import "dart:core" as core;
22
+
import "main_lib.dart" as mai;
23
+
24
+
import "dart:collection";
25
+
import "org-dartlang-testcase:///main_lib.dart";
26
+
27
+
abstract base class LegacyImplementBase<E extends col::LinkedListEntry<self::LegacyImplementBase::E> = col::LinkedListEntry<dynamic>> extends core::Object implements mai::LegacyImplementBaseCore<self::LegacyImplementBase::E> {
0 commit comments