Skip to content

Commit eb74f03

Browse files
authored
Update package:collection for the new strict_top_level_inference lint (#735)
* Update README.md * address strict_top_level_inference diagnostics * deprecate UnmodifiableMapMixin.first and UnmodifiableMapMixin.last * Update unmodifiable_wrappers.dart * ignore provide_deprecation_message diagnostics
1 parent 7a71ad6 commit eb74f03

File tree

4 files changed

+12
-9
lines changed

4 files changed

+12
-9
lines changed

pkgs/collection/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
`Map.entries`.
55
- Optimize equality and hash code for maps by using `update` and a `values`
66
iterator to avoid extra lookups.
7+
- Address diagnostics from `strict_top_level_inference`.
78

89
## 1.19.1
910

pkgs/collection/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,4 +56,4 @@ functions on an existing object.
5656

5757
Please file feature requests and bugs at the [issue tracker][tracker].
5858

59-
[tracker]: https://github.com/dart-lang/collection/issues
59+
[tracker]: https://github.com/dart-lang/core/issues/new/choose

pkgs/collection/lib/src/unmodifiable_wrappers.dart

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -194,11 +194,13 @@ abstract mixin class UnmodifiableMapMixin<K, V> implements Map<K, V> {
194194
@override
195195
void clear() => _throw();
196196

197-
/// Throws an [UnsupportedError];
198-
/// operations that change the map are disallowed.
199-
set first(_) => _throw();
200-
201-
/// Throws an [UnsupportedError];
202-
/// operations that change the map are disallowed.
203-
set last(_) => _throw();
197+
/// Throws an [UnsupportedError].
198+
// ignore: provide_deprecation_message
199+
@deprecated
200+
set first(Object? _) => _throw();
201+
202+
/// Throws an [UnsupportedError].
203+
// ignore: provide_deprecation_message
204+
@deprecated
205+
set last(Object? _) => _throw();
204206
}

pkgs/collection/test/extensions_test.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2225,7 +2225,7 @@ Iterable<T> iterable<T>(Iterable<T> values) sync* {
22252225
yield* values;
22262226
}
22272227

2228-
Never unreachable([_, __, ___]) => fail('Unreachable');
2228+
Never unreachable([dynamic _, dynamic __, dynamic ___]) => fail('Unreachable');
22292229

22302230
String toString(Object? o) => '$o';
22312231

0 commit comments

Comments
 (0)