Skip to content

Commit 80a7330

Browse files
committed
[collection] explicitly make BoolList abstract interface
It couldn't be extended in practice since it doesn't have a public constructor Also made the only implementations final
1 parent a6e81e0 commit 80a7330

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

pkgs/collection/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
- Add `IterableMapEntryExtension` for working on `Map` as a list of pairs, using
55
`Map.entries`.
6+
- Explicitly mark `BoolList` as `abstract interface`
67
- Address diagnostics from `strict_top_level_inference`.
78

89
## 1.19.1

pkgs/collection/lib/src/boollist.dart

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import 'unmodifiable_wrappers.dart' show NonGrowableListMixin;
1010
/// A space-efficient list of boolean values.
1111
///
1212
/// Uses list of integers as internal storage to reduce memory usage.
13-
abstract /*mixin*/ class BoolList with ListMixin<bool> {
13+
abstract interface class BoolList with ListMixin<bool> {
1414
static const int _entryShift = 5;
1515

1616
static const int _bitsPerEntry = 32;
@@ -180,7 +180,7 @@ abstract /*mixin*/ class BoolList with ListMixin<bool> {
180180
}
181181
}
182182

183-
class _GrowableBoolList extends BoolList {
183+
final class _GrowableBoolList extends BoolList {
184184
static const int _growthFactor = 2;
185185

186186
_GrowableBoolList._withCapacity(int length, int capacity)
@@ -228,7 +228,8 @@ class _GrowableBoolList extends BoolList {
228228
}
229229
}
230230

231-
class _NonGrowableBoolList extends BoolList with NonGrowableListMixin<bool> {
231+
final class _NonGrowableBoolList extends BoolList
232+
with NonGrowableListMixin<bool> {
232233
_NonGrowableBoolList._withCapacity(int length, int capacity)
233234
: super._(
234235
Uint32List(BoolList._lengthInWords(capacity)),

0 commit comments

Comments
 (0)