Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(44)

Unified Diff: sdk/lib/core/map.dart

Issue 838463002: Change List/Set/Map/Queue.from constructrs to accept any iterable. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: sdk/lib/core/map.dart
diff --git a/sdk/lib/core/map.dart b/sdk/lib/core/map.dart
index 81f94f04f7066f639e6af8d2c59dec2ee346cef6..c011a2044a5ade009120ebda2ec5379815b91210 100644
--- a/sdk/lib/core/map.dart
+++ b/sdk/lib/core/map.dart
@@ -41,11 +41,14 @@ abstract class Map<K, V> {
* Creates a [LinkedHashMap] instance that contains all key-value pairs of
* [other].
*
+ * The keys must all be assignable to [K] and the values to [V].
+ * The [other] map itself can have any type.
+ *
* A `LinkedHashMap` requires the keys to implement compatible
* `operator==` and `hashCode`, and it allows null as a key.
* It iterates in key insertion order.
*/
- factory Map.from(Map<K, V> other) = LinkedHashMap<K, V>.from;
+ factory Map.from(Map other) = LinkedHashMap<K, V>.from;
/**
* Creates an identity map with the default implementation, [LinkedHashMap].

Powered by Google App Engine
This is Rietveld 408576698