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

Issue 1840573002: Add type-asserting wrapper constructors. (Closed)

Created:
4 years, 8 months ago by nweiz
Modified:
4 years, 8 months ago
CC:
reviews_dartlang.org, Lasse Reichstein Nielsen
Base URL:
git@github.com:dart-lang/collection@master
Target Ref:
refs/heads/master
Visibility:
Public.

Description

Patch Set 1 #

Patch Set 2 : Use static methods instead. #

Total comments: 22

Patch Set 3 : Code review changes #

Unified diffs Side-by-side diffs Delta from patch set Stats (+1857 lines, -19 lines) Patch
M CHANGELOG.md View 1 2 1 chunk +7 lines, -1 line 0 comments Download
A lib/src/typed_wrappers.dart View 1 2 1 chunk +349 lines, -0 lines 0 comments Download
M lib/src/wrappers.dart View 1 6 chunks +85 lines, -17 lines 0 comments Download
M pubspec.yaml View 1 2 1 chunk +1 line, -1 line 0 comments Download
A test/typed_wrapper/iterable_test.dart View 1 1 chunk +355 lines, -0 lines 0 comments Download
A test/typed_wrapper/list_test.dart View 1 1 chunk +421 lines, -0 lines 0 comments Download
A test/typed_wrapper/map_test.dart View 1 1 chunk +315 lines, -0 lines 0 comments Download
A test/typed_wrapper/queue_test.dart View 1 1 chunk +141 lines, -0 lines 0 comments Download
A test/typed_wrapper/set_test.dart View 1 1 chunk +176 lines, -0 lines 0 comments Download
A test/utils.dart View 1 chunk +7 lines, -0 lines 0 comments Download

Messages

Total messages: 11 (3 generated)
nweiz
4 years, 8 months ago (2016-03-26 00:02:42 UTC) #2
nweiz
PTAL I switched this over to using static methods instead of constructors so that it ...
4 years, 8 months ago (2016-03-28 22:33:37 UTC) #3
nweiz
+cc lrn
4 years, 8 months ago (2016-03-28 22:39:51 UTC) #4
Lasse Reichstein Nielsen
LGTM with comments. https://codereview.chromium.org/1840573002/diff/20001/lib/src/typed_wrappers.dart File lib/src/typed_wrappers.dart (right): https://codereview.chromium.org/1840573002/diff/20001/lib/src/typed_wrappers.dart#newcode20 lib/src/typed_wrappers.dart:20: const _TypedIterableBase(); Don't make a const ...
4 years, 8 months ago (2016-03-29 12:56:25 UTC) #6
nweiz
Code review changes
4 years, 8 months ago (2016-03-29 20:17:55 UTC) #7
nweiz
https://codereview.chromium.org/1840573002/diff/20001/lib/src/typed_wrappers.dart File lib/src/typed_wrappers.dart (right): https://codereview.chromium.org/1840573002/diff/20001/lib/src/typed_wrappers.dart#newcode20 lib/src/typed_wrappers.dart:20: const _TypedIterableBase(); On 2016/03/29 12:56:24, Lasse Reichstein Nielsen wrote: ...
4 years, 8 months ago (2016-03-29 20:18:05 UTC) #8
nweiz
Committed patchset #3 (id:40001) manually as 16fae6cf8afd57b03a3f08c59a3a9556c307caa3 (presubmit successful).
4 years, 8 months ago (2016-03-29 20:20:35 UTC) #10
Lasse Reichstein Nielsen
4 years, 8 months ago (2016-03-29 20:49:58 UTC) #11
Message was sent while issue was closed.
LGTM

https://codereview.chromium.org/1840573002/diff/20001/lib/src/wrappers.dart
File lib/src/wrappers.dart (right):

https://codereview.chromium.org/1840573002/diff/20001/lib/src/wrappers.dart#n...
lib/src/wrappers.dart:104: /// unmodified.
Then keep "typed". As long as it's described what it does, I guess it's ok.

The return type of `operator[]` in `List<E>` is `E` or `first` in `Iterable<E>`,
and it should allow returning null. I don't think strong mode prevents that
(unless they have incorporated non-null types too, I don't know strong mode well
enough to know for sure).

The "as E" casts will allow null, so if you can get null then the typed wrapper
won't catch it.

Powered by Google App Engine
This is Rietveld 408576698