Fix inconsistent APIs
Strong mode is complaining about these - they are not consistent with the corresponding APIs in Map and Set.
R=lrn@google.com, nweiz@google.com
Review URL: https://codereview.chromium.org//1353873002 .
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 098e475..ad50fa1 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,3 +1,7 @@
+## 1.1.3
+
+* Fix type inconsistencies with `Map` and `Set`.
+
## 1.1.2
* Export `UnmodifiableMapView` from the Dart core libraries.
diff --git a/lib/src/unmodifiable_wrappers.dart b/lib/src/unmodifiable_wrappers.dart
index 7f7d901..efe3c9d 100644
--- a/lib/src/unmodifiable_wrappers.dart
+++ b/lib/src/unmodifiable_wrappers.dart
@@ -227,7 +227,7 @@
* Throws an [UnsupportedError];
* operations that change the map are disallowed.
*/
- V remove(K key) => _throw();
+ V remove(Object key) => _throw();
/**
* Throws an [UnsupportedError];
diff --git a/lib/wrappers.dart b/lib/wrappers.dart
index 34f812c..9f8b833 100644
--- a/lib/wrappers.dart
+++ b/lib/wrappers.dart
@@ -234,7 +234,7 @@
Set<E> intersection(Set<Object> other) => _setBase.intersection(other);
- E lookup(E element) => _setBase.lookup(element);
+ E lookup(Object element) => _setBase.lookup(element);
bool remove(Object value) => _setBase.remove(value);
@@ -518,7 +518,7 @@
*/
Set<V> intersection(Set<Object> other) => where(other.contains).toSet();
- V lookup(V element) => _baseMap[_keyForValue(element)];
+ V lookup(Object element) => _baseMap[_keyForValue(element)];
bool remove(Object value) {
if (value != null && value is! V) return false;
diff --git a/pubspec.yaml b/pubspec.yaml
index 1517353..514ec4b 100644
--- a/pubspec.yaml
+++ b/pubspec.yaml
@@ -1,5 +1,5 @@
name: collection
-version: 1.1.2
+version: 1.1.3
author: Dart Team <misc@dartlang.org>
description: Collections and utilities functions and classes related to collections.
homepage: https://www.github.com/dart-lang/collection