From c667b720c687e8d26dcc69ae6e3ceab304372e29 Mon Sep 17 00:00:00 2001 From: Devon Carew Date: Thu, 19 Dec 2024 18:50:07 -0800 Subject: [PATCH 1/5] Update README.md --- pkgs/collection/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 From b12421646917507c5373f6698edabd9a8c34919b Mon Sep 17 00:00:00 2001 From: Devon Carew Date: Fri, 20 Dec 2024 10:21:46 -0800 Subject: [PATCH 2/5] address strict_top_level_inference diagnostics --- pkgs/collection/CHANGELOG.md | 1 + pkgs/collection/lib/src/unmodifiable_wrappers.dart | 8 -------- pkgs/collection/test/extensions_test.dart | 2 +- 3 files changed, 2 insertions(+), 9 deletions(-) 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/lib/src/unmodifiable_wrappers.dart b/pkgs/collection/lib/src/unmodifiable_wrappers.dart index 3b211c07..897ccdbc 100644 --- a/pkgs/collection/lib/src/unmodifiable_wrappers.dart +++ b/pkgs/collection/lib/src/unmodifiable_wrappers.dart @@ -193,12 +193,4 @@ abstract mixin class UnmodifiableMapMixin implements Map { /// operations that change the map are disallowed. @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(); } 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'; From c2d52896c1c8f75de89040c9ce222481ba0ab792 Mon Sep 17 00:00:00 2001 From: Devon Carew Date: Fri, 20 Dec 2024 22:57:33 +0000 Subject: [PATCH 3/5] deprecate UnmodifiableMapMixin.first and UnmodifiableMapMixin.last --- pkgs/collection/lib/src/unmodifiable_wrappers.dart | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/pkgs/collection/lib/src/unmodifiable_wrappers.dart b/pkgs/collection/lib/src/unmodifiable_wrappers.dart index 897ccdbc..78484ab0 100644 --- a/pkgs/collection/lib/src/unmodifiable_wrappers.dart +++ b/pkgs/collection/lib/src/unmodifiable_wrappers.dart @@ -193,4 +193,12 @@ abstract mixin class UnmodifiableMapMixin implements Map { /// operations that change the map are disallowed. @override void clear() => _throw(); + + /// Throws an [UnsupportedError]. + @Deprecated('This will be removed at a later date.') + set first(dynamic _) => _throw(); + + /// Throws an [UnsupportedError]. + @Deprecated('This will be removed at a later date.') + set last(dynamic _) => _throw(); } From ca1527f7bb0461a2117f6298ad770e02a0ee16f0 Mon Sep 17 00:00:00 2001 From: Devon Carew Date: Mon, 6 Jan 2025 09:46:01 -0800 Subject: [PATCH 4/5] Update unmodifiable_wrappers.dart --- pkgs/collection/lib/src/unmodifiable_wrappers.dart | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pkgs/collection/lib/src/unmodifiable_wrappers.dart b/pkgs/collection/lib/src/unmodifiable_wrappers.dart index 78484ab0..f2008ce4 100644 --- a/pkgs/collection/lib/src/unmodifiable_wrappers.dart +++ b/pkgs/collection/lib/src/unmodifiable_wrappers.dart @@ -195,10 +195,10 @@ abstract mixin class UnmodifiableMapMixin implements Map { void clear() => _throw(); /// Throws an [UnsupportedError]. - @Deprecated('This will be removed at a later date.') - set first(dynamic _) => _throw(); + @deprecated + set first(Object? _) => _throw(); /// Throws an [UnsupportedError]. - @Deprecated('This will be removed at a later date.') - set last(dynamic _) => _throw(); + @deprecated + set last(Object? _) => _throw(); } From dd2ff12741ae9555a386301181e03ed24894d0e7 Mon Sep 17 00:00:00 2001 From: Devon Carew Date: Mon, 6 Jan 2025 09:49:09 -0800 Subject: [PATCH 5/5] ignore provide_deprecation_message diagnostics --- pkgs/collection/lib/src/unmodifiable_wrappers.dart | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkgs/collection/lib/src/unmodifiable_wrappers.dart b/pkgs/collection/lib/src/unmodifiable_wrappers.dart index f2008ce4..a73a55b3 100644 --- a/pkgs/collection/lib/src/unmodifiable_wrappers.dart +++ b/pkgs/collection/lib/src/unmodifiable_wrappers.dart @@ -195,10 +195,12 @@ abstract mixin class UnmodifiableMapMixin implements Map { void clear() => _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(); }