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

Issue 838463002: Change List/Set/Map/Queue.from constructrs to accept any iterable. (Closed)

Created:
5 years, 11 months ago by Lasse Reichstein Nielsen
Modified:
5 years, 11 months ago
Reviewers:
*Søren Gjesse, floitsch
CC:
reviews_dartlang.org, vm-dev_dartlang.org, ahe
Target Ref:
refs/remotes/git-svn
Visibility:
Public.

Description

Change List/Set/Map/Queue.from constructrs to accept any iterable. This allows using the .from constructor as a cast: new Set<int>.from(numSetContainingOnlyInts); BUG= http://dartbug.com/21731 R=sgjesse@google.com Committed: https://code.google.com/p/dart/source/detail?r=42620

Patch Set 1 #

Total comments: 13
Unified diffs Side-by-side diffs Delta from patch set Stats (+200 lines, -47 lines) Patch
M runtime/lib/array_patch.dart View 1 chunk +5 lines, -5 lines 0 comments Download
M sdk/lib/_internal/compiler/js_lib/core_patch.dart View 1 chunk +2 lines, -2 lines 0 comments Download
M sdk/lib/collection/hash_map.dart View 1 chunk +5 lines, -3 lines 3 comments Download
M sdk/lib/collection/hash_set.dart View 2 chunks +17 lines, -7 lines 6 comments Download
M sdk/lib/collection/linked_hash_map.dart View 1 chunk +4 lines, -2 lines 0 comments Download
M sdk/lib/collection/linked_hash_set.dart View 1 chunk +20 lines, -2 lines 2 comments Download
M sdk/lib/collection/queue.dart View 3 chunks +32 lines, -11 lines 0 comments Download
M sdk/lib/collection/splay_tree.dart View 2 chunks +23 lines, -3 lines 2 comments Download
M sdk/lib/core/iterable.dart View 1 chunk +3 lines, -0 lines 0 comments Download
M sdk/lib/core/list.dart View 1 chunk +4 lines, -4 lines 0 comments Download
M sdk/lib/core/map.dart View 1 chunk +4 lines, -1 line 0 comments Download
M sdk/lib/core/set.dart View 1 chunk +13 lines, -4 lines 0 comments Download
M tests/corelib/set_test.dart View 2 chunks +51 lines, -0 lines 0 comments Download
M tests/corelib/splay_tree_test.dart View 3 chunks +17 lines, -3 lines 0 comments Download

Messages

Total messages: 9 (2 generated)
Lasse Reichstein Nielsen
5 years, 11 months ago (2015-01-05 14:38:19 UTC) #3
floitsch
DBC. (looks good to me, but I didn't look very closely). https://codereview.chromium.org/838463002/diff/1/sdk/lib/collection/hash_set.dart File sdk/lib/collection/hash_set.dart (right): ...
5 years, 11 months ago (2015-01-05 14:45:30 UTC) #4
Søren Gjesse
lgtm https://codereview.chromium.org/838463002/diff/1/sdk/lib/collection/hash_map.dart File sdk/lib/collection/hash_map.dart (right): https://codereview.chromium.org/838463002/diff/1/sdk/lib/collection/hash_map.dart#newcode87 sdk/lib/collection/hash_map.dart:87: other.forEach((k, v) { result[k] = v; }); Add ...
5 years, 11 months ago (2015-01-05 15:35:15 UTC) #5
Lasse Reichstein Nielsen
https://codereview.chromium.org/838463002/diff/1/sdk/lib/collection/hash_map.dart File sdk/lib/collection/hash_map.dart (right): https://codereview.chromium.org/838463002/diff/1/sdk/lib/collection/hash_map.dart#newcode87 sdk/lib/collection/hash_map.dart:87: other.forEach((k, v) { result[k] = v; }); The forEach ...
5 years, 11 months ago (2015-01-06 10:14:46 UTC) #6
Lasse Reichstein Nielsen
Committed patchset #1 (id:1) manually as 42620 (presubmit successful).
5 years, 11 months ago (2015-01-06 10:15:41 UTC) #7
Søren Gjesse
https://codereview.chromium.org/838463002/diff/1/sdk/lib/collection/hash_map.dart File sdk/lib/collection/hash_map.dart (right): https://codereview.chromium.org/838463002/diff/1/sdk/lib/collection/hash_map.dart#newcode87 sdk/lib/collection/hash_map.dart:87: other.forEach((k, v) { result[k] = v; }); On 2015/01/06 ...
5 years, 11 months ago (2015-01-06 12:09:05 UTC) #8
Lasse Reichstein Nielsen
5 years, 11 months ago (2015-01-07 07:56:45 UTC) #9
Message was sent while issue was closed.
https://codereview.chromium.org/838463002/diff/1/sdk/lib/collection/hash_set....
File sdk/lib/collection/hash_set.dart (right):

https://codereview.chromium.org/838463002/diff/1/sdk/lib/collection/hash_set....
sdk/lib/collection/hash_set.dart:93: * All the [elements] should be assignable
to [E].
The spec tries to specify how references in DartDoc are resolved, but it's
somewhat vague.

In practice it *should* work so that any name that can be referenced from
anywhere inside the documented declaration, is in scope.
The type parameter of a class should be in scope for DartDoc in the class
documentation and in any DartDoc inside the class (I don't think we make
exceptions for static functions).

A type parameter can be used in a generative constructor, so it should be in
scope here. I haven't checked if it actually works with the DartDoc tool,
though, but if not, I'll have to file a bug report :)

Powered by Google App Engine
This is Rietveld 408576698