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

Side by Side Diff: test/dart_codegen/expect/async/stream_pipe.dart

Issue 1010893004: Allow S->T <: dynamic->T (Closed) Base URL: https://github.com/dart-lang/dev_compiler.git@master
Patch Set: Rebase and address comments Created 5 years, 9 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 unified diff | Download patch
OLDNEW
1 part of dart.async; 1 part of dart.async;
2 _runUserCode(userCode(), onSuccess(value), onError(error, StackTrace stackTrace )) { 2 _runUserCode(userCode(), onSuccess(value), onError(error, StackTrace stackTrace )) {
3 try { 3 try {
4 onSuccess(userCode()); 4 onSuccess(userCode());
5 } 5 }
6 catch (e, s) { 6 catch (e, s) {
7 AsyncError replacement = Zone.current.errorCallback(e, s); 7 AsyncError replacement = Zone.current.errorCallback(e, s);
8 if (replacement == null) { 8 if (replacement == null) {
9 onError(e, s); 9 onError(e, s);
10 } 10 }
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
119 catch (e, s) { 119 catch (e, s) {
120 _addErrorWithReplacement(sink, e, s); 120 _addErrorWithReplacement(sink, e, s);
121 return;} 121 return;}
122 if (satisfies) { 122 if (satisfies) {
123 sink._add(inputEvent); 123 sink._add(inputEvent);
124 } 124 }
125 } 125 }
126 } 126 }
127 typedef T _Transformation<S, T>(S value); 127 typedef T _Transformation<S, T>(S value);
128 class _MapStream<S, T> extends _ForwardingStream<S, T> {final _Transformation _ transform; 128 class _MapStream<S, T> extends _ForwardingStream<S, T> {final _Transformation _ transform;
129 _MapStream(Stream<S> source, T transform(S event)) : this._transform = DEVC$RT. wrap((T f(S __u138)) { 129 _MapStream(Stream<S> source, T transform(S event)) : this._transform = transfor m, super(source);
130 T c(S x0) => f(DEVC$RT.cast(x0, dynamic, S, "CastParam", """line 230, column 27 of dart:async/stream_pipe.dart: """, x0 is S, false));
131 return f == null ? null : c;
132 }
133 , transform, DEVC$RT.type((__t141<S, T> _) {
134 }
135 ), __t139, "Wrap", """line 230, column 27 of dart:async/stream_pipe.dart: """, t ransform is __t139), super(source);
136 void _handleData(S inputEvent, _EventSink<T> sink) { 130 void _handleData(S inputEvent, _EventSink<T> sink) {
137 T outputEvent; 131 T outputEvent;
138 try { 132 try {
139 outputEvent = ((__x143) => DEVC$RT.cast(__x143, dynamic, T, "CastGeneral", """li ne 235, column 21 of dart:async/stream_pipe.dart: """, __x143 is T, false))(_tra nsform(inputEvent)); 133 outputEvent = ((__x104) => DEVC$RT.cast(__x104, dynamic, T, "CastGeneral", """li ne 235, column 21 of dart:async/stream_pipe.dart: """, __x104 is T, false))(_tra nsform(inputEvent));
140 } 134 }
141 catch (e, s) { 135 catch (e, s) {
142 _addErrorWithReplacement(sink, e, s); 136 _addErrorWithReplacement(sink, e, s);
143 return;} 137 return;}
144 sink._add(outputEvent); 138 sink._add(outputEvent);
145 } 139 }
146 } 140 }
147 class _ExpandStream<S, T> extends _ForwardingStream<S, T> {final _Transformatio n<S, Iterable<T>> _expand; 141 class _ExpandStream<S, T> extends _ForwardingStream<S, T> {final _Transformatio n<S, Iterable<T>> _expand;
148 _ExpandStream(Stream<S> source, Iterable<T> expand(S event)) : this._expand = e xpand, super(source); 142 _ExpandStream(Stream<S> source, Iterable<T> expand(S event)) : this._expand = e xpand, super(source);
149 void _handleData(S inputEvent, _EventSink<T> sink) { 143 void _handleData(S inputEvent, _EventSink<T> sink) {
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
278 _addErrorWithReplacement(sink, e, s); 272 _addErrorWithReplacement(sink, e, s);
279 return null; 273 return null;
280 } 274 }
281 if (!isEqual) { 275 if (!isEqual) {
282 sink._add(inputEvent); 276 sink._add(inputEvent);
283 _previous = inputEvent; 277 _previous = inputEvent;
284 } 278 }
285 } 279 }
286 } 280 }
287 } 281 }
288 typedef dynamic __t139(dynamic __u140);
289 typedef T __t141<S, T>(S __u142);
OLDNEW
« no previous file with comments | « test/dart_codegen/expect/async/stream_impl.dart ('k') | test/dart_codegen/expect/async/stream_transformers.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698