diff --git a/pkgs/collection/CHANGELOG.md b/pkgs/collection/CHANGELOG.md index 2891b0dc..32318658 100644 --- a/pkgs/collection/CHANGELOG.md +++ b/pkgs/collection/CHANGELOG.md @@ -4,6 +4,7 @@ `Map.entries`. - Optimize equality and hash code for maps by using `update` and a `values` iterator to avoid extra lookups. +- Address diagnostics from `strict_top_level_inference`. ## 1.19.1 diff --git a/pkgs/collection/README.md b/pkgs/collection/README.md index 63f705c7..8c72c67e 100644 --- a/pkgs/collection/README.md +++ b/pkgs/collection/README.md @@ -56,4 +56,4 @@ functions on an existing object. Please file feature requests and bugs at the [issue tracker][tracker]. -[tracker]: https://github.com/dart-lang/collection/issues +[tracker]: https://github.com/dart-lang/core/issues/new/choose diff --git a/pkgs/collection/lib/src/unmodifiable_wrappers.dart b/pkgs/collection/lib/src/unmodifiable_wrappers.dart index 3b211c07..a73a55b3 100644 --- a/pkgs/collection/lib/src/unmodifiable_wrappers.dart +++ b/pkgs/collection/lib/src/unmodifiable_wrappers.dart @@ -194,11 +194,13 @@ abstract mixin class UnmodifiableMapMixin implements Map { @override void clear() => _throw(); - /// Throws an [UnsupportedError]; - /// operations that change the map are disallowed. - set first(_) => _throw(); - - /// Throws an [UnsupportedError]; - /// operations that change the map are disallowed. - set last(_) => _throw(); + /// Throws an [UnsupportedError]. + // ignore: provide_deprecation_message + @deprecated + set first(Object? _) => _throw(); + + /// Throws an [UnsupportedError]. + // ignore: provide_deprecation_message + @deprecated + set last(Object? _) => _throw(); } diff --git a/pkgs/collection/test/extensions_test.dart b/pkgs/collection/test/extensions_test.dart index 6c5b45f1..dd920597 100644 --- a/pkgs/collection/test/extensions_test.dart +++ b/pkgs/collection/test/extensions_test.dart @@ -2225,7 +2225,7 @@ Iterable iterable(Iterable values) sync* { yield* values; } -Never unreachable([_, __, ___]) => fail('Unreachable'); +Never unreachable([dynamic _, dynamic __, dynamic ___]) => fail('Unreachable'); String toString(Object? o) => '$o';