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

Issue 2954383002: Relax typing on Stream.transform

Created:
3 years, 5 months ago by vsm
Modified:
3 years, 5 months ago
CC:
dev-compiler+reviews_dartlang.org
Target Ref:
refs/heads/master
Visibility:
Public.

Description

Relax typing on Stream.transform

Patch Set 1 #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+2 lines, -2 lines) Patch
M pkg/dev_compiler/lib/sdk/ddc_sdk.sum View Binary file 0 comments Download
M sdk/lib/async/stream.dart View 1 chunk +2 lines, -2 lines 2 comments Download

Messages

Total messages: 3 (1 generated)
vsm
https://codereview.chromium.org/2954383002/diff/1/sdk/lib/async/stream.dart File sdk/lib/async/stream.dart (right): https://codereview.chromium.org/2954383002/diff/1/sdk/lib/async/stream.dart#newcode619 sdk/lib/async/stream.dart:619: return streamTransformer.bind(this.map<T>((x) => x)); Actually, not sure the map ...
3 years, 5 months ago (2017-06-26 18:28:51 UTC) #1
Lasse Reichstein Nielsen
3 years, 5 months ago (2017-06-27 05:45:18 UTC) #3
https://codereview.chromium.org/2954383002/diff/1/sdk/lib/async/stream.dart
File sdk/lib/async/stream.dart (right):

https://codereview.chromium.org/2954383002/diff/1/sdk/lib/async/stream.dart#n...
sdk/lib/async/stream.dart:619: return streamTransformer.bind(this.map<T>((x) =>
x));
It should work, the transformer claims to handle all types, so there should be
no need to change the type of elements put into it. 

It's only due to implicit down-cast that the map operation is allowed. You are
implicitly casting `dynamic` to `T` in the `=> x` return, so you'll get a
dynamic check there.

Powered by Google App Engine
This is Rietveld 408576698