Update Set.difference to take a Set<Object>.
BUG= http://dartbug.com/27573
R=lrn@google.com
Review URL: https://codereview.chromium.org//2418763002 .
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 330e026..2edb5e6 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,3 +1,7 @@
+## 1.9.2
+
+* `Set.difference` now takes a `Set<Object>` as argument.
+
## 1.9.1
* Fix some documentation bugs.
diff --git a/lib/src/typed_wrappers.dart b/lib/src/typed_wrappers.dart
index 1dcb3b7..9416d81 100644
--- a/lib/src/typed_wrappers.dart
+++ b/lib/src/typed_wrappers.dart
@@ -226,7 +226,7 @@
bool containsAll(Iterable<Object> other) => _setBase.containsAll(other);
- Set<E> difference(Set<E> other) =>
+ Set<E> difference(Set<Object> other) =>
new TypeSafeSet<E>(_setBase.difference(other));
Set<E> intersection(Set<Object> other) =>
diff --git a/lib/src/wrappers.dart b/lib/src/wrappers.dart
index 752987b..92760f6 100644
--- a/lib/src/wrappers.dart
+++ b/lib/src/wrappers.dart
@@ -253,7 +253,7 @@
bool containsAll(Iterable<Object> other) => _setBase.containsAll(other);
- Set<E> difference(Set<E> other) => _setBase.difference(other);
+ Set<E> difference(Set<Object> other) => _setBase.difference(other);
Set<E> intersection(Set<Object> other) => _setBase.intersection(other);
@@ -436,7 +436,7 @@
///
/// Note that the returned set will use the default equality operation, which
/// may be different than the equality operation [this] uses.
- Set<E> difference(Set<E> other) =>
+ Set<E> difference(Set<Object> other) =>
where((element) => !other.contains(element)).toSet();
/// Returns a new set which is the intersection between [this] and [other].
@@ -537,7 +537,7 @@
///
/// Note that the returned set will use the default equality operation, which
/// may be different than the equality operation [this] uses.
- Set<V> difference(Set<V> other) =>
+ Set<V> difference(Set<Object> other) =>
where((element) => !other.contains(element)).toSet();
/// Returns a new set which is the intersection between [this] and [other].
diff --git a/pubspec.yaml b/pubspec.yaml
index eb9a3a2..f78a75a 100644
--- a/pubspec.yaml
+++ b/pubspec.yaml
@@ -1,9 +1,9 @@
name: collection
-version: 1.9.1
+version: 1.10.0
author: Dart Team <misc@dartlang.org>
description: Collections and utilities functions and classes related to collections.
homepage: https://www.github.com/dart-lang/collection
environment:
- sdk: '>=1.12.0 <2.0.0'
+ sdk: '>=1.21.0 <2.0.0'
dev_dependencies:
test: '^0.12.0'