| Index: test/dart_codegen/expect/async/stream.dart
|
| diff --git a/test/dart_codegen/expect/async/stream.dart b/test/dart_codegen/expect/async/stream.dart
|
| index 44c536cc5eb608bbd0b8c0aafcff5890908e8fb3..0c2fdb28f6605753872b284fdebbd4cbbe3e7469 100644
|
| --- a/test/dart_codegen/expect/async/stream.dart
|
| +++ b/test/dart_codegen/expect/async/stream.dart
|
| @@ -2,13 +2,9 @@ part of dart.async;
|
| abstract class Stream<T> {Stream();
|
| factory Stream.fromFuture(Future<T> future) {
|
| _StreamController<T> controller = new StreamController<T>(sync: true);
|
| - future.then(((__x30) => DEVC$RT.wrap((dynamic f(dynamic __u25)) {
|
| - dynamic c(dynamic x0) => f(x0);
|
| - return f == null ? null : c;
|
| + future.then(((__x25) => DEVC$RT.cast(__x25, __t23, DEVC$RT.type((__t21<T> _) {
|
| }
|
| - , __x30, __t28, DEVC$RT.type((__t26<T> _) {
|
| - }
|
| - ), "WrapLiteral", """line 88, column 17 of dart:async/stream.dart: """, __x30 is __t26<T>))((value) {
|
| + ), "InferableClosure", """line 88, column 17 of dart:async/stream.dart: """, __x25 is __t21<T>, false))((value) {
|
| controller._add(DEVC$RT.cast(value, dynamic, T, "CompositeCast", """line 89, column 25 of dart:async/stream.dart: """, value is T, false));
|
| controller._closeUnchecked();
|
| }
|
| @@ -23,13 +19,9 @@ part of dart.async;
|
| return new _GeneratedStreamImpl<T>(() => new _IterablePendingEvents<T>(data));
|
| }
|
| factory Stream.periodic(Duration period, [T computation(int computationCount)]) {
|
| - if (computation == null) computation = ((__x36) => DEVC$RT.wrap((dynamic f(dynamic __u31)) {
|
| - dynamic c(dynamic x0) => f(x0);
|
| - return f == null ? null : c;
|
| - }
|
| - , __x36, __t34, DEVC$RT.type((__t32<T> _) {
|
| + if (computation == null) computation = ((__x30) => DEVC$RT.cast(__x30, __t28, DEVC$RT.type((__t26<T> _) {
|
| }
|
| - ), "Wrap", """line 126, column 44 of dart:async/stream.dart: """, __x36 is __t32<T>))(((i) => null));
|
| + ), "CompositeCast", """line 126, column 44 of dart:async/stream.dart: """, __x30 is __t26<T>, false))(((i) => null));
|
| Timer timer;
|
| int computationCount = 0;
|
| StreamController<T> controller;
|
| @@ -72,43 +64,19 @@ part of dart.async;
|
| return controller.stream;
|
| }
|
| factory Stream.eventTransformed(Stream source, EventSink mapSink(EventSink<T> sink)) {
|
| - return new _BoundSinkStream<dynamic, T>(source, DEVC$RT.wrap((EventSink<dynamic> f(EventSink<T> __u37)) {
|
| - EventSink<dynamic> c(EventSink<T> x0) => f(DEVC$RT.cast(x0, DEVC$RT.type((EventSink<dynamic> _) {
|
| - }
|
| - ), DEVC$RT.type((EventSink<T> _) {
|
| - }
|
| - ), "CastParam", """line 216, column 41 of dart:async/stream.dart: """, x0 is EventSink<T>, false));
|
| - return f == null ? null : c;
|
| + return new _BoundSinkStream<dynamic, T>(source, DEVC$RT.cast(mapSink, DEVC$RT.type((__t33<T> _) {
|
| }
|
| - , mapSink, DEVC$RT.type((__t40<T> _) {
|
| - }
|
| - ), __t38, "Wrap", """line 216, column 41 of dart:async/stream.dart: """, mapSink is __t38));
|
| + ), __t31, "CompositeCast", """line 216, column 41 of dart:async/stream.dart: """, mapSink is __t31, false));
|
| }
|
| bool get isBroadcast => false;
|
| Stream<T> asBroadcastStream({
|
| void onListen(StreamSubscription<T> subscription), void onCancel(StreamSubscription<T> subscription)}
|
| ) {
|
| - return new _AsBroadcastStream<T>(this, DEVC$RT.wrap((void f(StreamSubscription<T> __u42)) {
|
| - void c(StreamSubscription<T> x0) => f(DEVC$RT.cast(x0, DEVC$RT.type((StreamSubscription<dynamic> _) {
|
| - }
|
| - ), DEVC$RT.type((StreamSubscription<T> _) {
|
| - }
|
| - ), "CastParam", """line 248, column 44 of dart:async/stream.dart: """, x0 is StreamSubscription<T>, false));
|
| - return f == null ? null : c;
|
| + return new _AsBroadcastStream<T>(this, DEVC$RT.cast(onListen, DEVC$RT.type((__t37<T> _) {
|
| }
|
| - , onListen, DEVC$RT.type((__t45<T> _) {
|
| + ), __t35, "CompositeCast", """line 248, column 44 of dart:async/stream.dart: """, onListen is __t35, false), DEVC$RT.cast(onCancel, DEVC$RT.type((__t37<T> _) {
|
| }
|
| - ), __t43, "Wrap", """line 248, column 44 of dart:async/stream.dart: """, onListen is __t43), DEVC$RT.wrap((void f(StreamSubscription<T> __u47)) {
|
| - void c(StreamSubscription<T> x0) => f(DEVC$RT.cast(x0, DEVC$RT.type((StreamSubscription<dynamic> _) {
|
| - }
|
| - ), DEVC$RT.type((StreamSubscription<T> _) {
|
| - }
|
| - ), "CastParam", """line 248, column 54 of dart:async/stream.dart: """, x0 is StreamSubscription<T>, false));
|
| - return f == null ? null : c;
|
| - }
|
| - , onCancel, DEVC$RT.type((__t45<T> _) {
|
| - }
|
| - ), __t43, "Wrap", """line 248, column 54 of dart:async/stream.dart: """, onCancel is __t43));
|
| + ), __t35, "CompositeCast", """line 248, column 54 of dart:async/stream.dart: """, onCancel is __t35, false));
|
| }
|
| StreamSubscription<T> listen(void onData(T event), {
|
| Function onError, void onDone(), bool cancelOnError}
|
| @@ -228,7 +196,7 @@ part of dart.async;
|
| _runUserCode(() => combine(value, element), (T newValue) {
|
| value = newValue;
|
| }
|
| - , ((__x51) => DEVC$RT.cast(__x51, dynamic, __t48, "CompositeCast", """line 501, column 24 of dart:async/stream.dart: """, __x51 is __t48, false))(_cancelAndErrorClosure(subscription, result)));
|
| + , ((__x42) => DEVC$RT.cast(__x42, dynamic, __t39, "CompositeCast", """line 501, column 24 of dart:async/stream.dart: """, __x42 is __t39, false))(_cancelAndErrorClosure(subscription, result)));
|
| }
|
| else {
|
| value = element;
|
| @@ -259,7 +227,7 @@ part of dart.async;
|
| _runUserCode(() => combine(value, element), (newValue) {
|
| value = newValue;
|
| }
|
| - , ((__x52) => DEVC$RT.cast(__x52, dynamic, __t48, "CompositeCast", """line 534, column 11 of dart:async/stream.dart: """, __x52 is __t48, false))(_cancelAndErrorClosure(subscription, result)));
|
| + , ((__x43) => DEVC$RT.cast(__x43, dynamic, __t39, "CompositeCast", """line 534, column 11 of dart:async/stream.dart: """, __x43 is __t39, false))(_cancelAndErrorClosure(subscription, result)));
|
| }
|
| , onError: (e, st) {
|
| result._completeError(e, DEVC$RT.cast(st, dynamic, StackTrace, "DynamicCast", """line 538, column 34 of dart:async/stream.dart: """, st is StackTrace, true));
|
| @@ -305,7 +273,7 @@ part of dart.async;
|
| _cancelAndValue(subscription, future, true);
|
| }
|
| }
|
| - , ((__x53) => DEVC$RT.cast(__x53, dynamic, __t48, "CompositeCast", """line 602, column 13 of dart:async/stream.dart: """, __x53 is __t48, false))(_cancelAndErrorClosure(subscription, future)));
|
| + , ((__x44) => DEVC$RT.cast(__x44, dynamic, __t39, "CompositeCast", """line 602, column 13 of dart:async/stream.dart: """, __x44 is __t39, false))(_cancelAndErrorClosure(subscription, future)));
|
| }
|
| , onError: future._completeError, onDone: () {
|
| future._complete(false);
|
| @@ -319,7 +287,7 @@ part of dart.async;
|
| subscription = this.listen((T element) {
|
| _runUserCode(() => action(element), (_) {
|
| }
|
| - , ((__x54) => DEVC$RT.cast(__x54, dynamic, __t48, "CompositeCast", """line 628, column 13 of dart:async/stream.dart: """, __x54 is __t48, false))(_cancelAndErrorClosure(subscription, future)));
|
| + , ((__x45) => DEVC$RT.cast(__x45, dynamic, __t39, "CompositeCast", """line 628, column 13 of dart:async/stream.dart: """, __x45 is __t39, false))(_cancelAndErrorClosure(subscription, future)));
|
| }
|
| , onError: future._completeError, onDone: () {
|
| future._complete(null);
|
| @@ -336,7 +304,7 @@ part of dart.async;
|
| _cancelAndValue(subscription, future, false);
|
| }
|
| }
|
| - , ((__x55) => DEVC$RT.cast(__x55, dynamic, __t48, "CompositeCast", """line 657, column 13 of dart:async/stream.dart: """, __x55 is __t48, false))(_cancelAndErrorClosure(subscription, future)));
|
| + , ((__x46) => DEVC$RT.cast(__x46, dynamic, __t39, "CompositeCast", """line 657, column 13 of dart:async/stream.dart: """, __x46 is __t39, false))(_cancelAndErrorClosure(subscription, future)));
|
| }
|
| , onError: future._completeError, onDone: () {
|
| future._complete(true);
|
| @@ -353,7 +321,7 @@ part of dart.async;
|
| _cancelAndValue(subscription, future, true);
|
| }
|
| }
|
| - , ((__x56) => DEVC$RT.cast(__x56, dynamic, __t48, "CompositeCast", """line 694, column 13 of dart:async/stream.dart: """, __x56 is __t48, false))(_cancelAndErrorClosure(subscription, future)));
|
| + , ((__x47) => DEVC$RT.cast(__x47, dynamic, __t39, "CompositeCast", """line 694, column 13 of dart:async/stream.dart: """, __x47 is __t39, false))(_cancelAndErrorClosure(subscription, future)));
|
| }
|
| , onError: future._completeError, onDone: () {
|
| future._complete(false);
|
| @@ -364,13 +332,9 @@ part of dart.async;
|
| Future<int> get length {
|
| _Future<int> future = new _Future<int>();
|
| int count = 0;
|
| - this.listen(((__x60) => DEVC$RT.wrap((dynamic f(dynamic __u57)) {
|
| - dynamic c(dynamic x0) => f(x0);
|
| - return f == null ? null : c;
|
| + this.listen(((__x50) => DEVC$RT.cast(__x50, __t23, DEVC$RT.type((__t48<T> _) {
|
| }
|
| - , __x60, __t28, DEVC$RT.type((__t58<T> _) {
|
| - }
|
| - ), "WrapLiteral", """line 711, column 7 of dart:async/stream.dart: """, __x60 is __t58<T>))((_) {
|
| + ), "InferableClosure", """line 711, column 7 of dart:async/stream.dart: """, __x50 is __t48<T>, false))((_) {
|
| count++;
|
| }
|
| ), onError: future._completeError, onDone: () {
|
| @@ -382,13 +346,9 @@ part of dart.async;
|
| Future<bool> get isEmpty {
|
| _Future<bool> future = new _Future<bool>();
|
| StreamSubscription subscription;
|
| - subscription = this.listen(((__x62) => DEVC$RT.wrap((dynamic f(dynamic __u61)) {
|
| - dynamic c(dynamic x0) => f(x0);
|
| - return f == null ? null : c;
|
| - }
|
| - , __x62, __t28, DEVC$RT.type((__t58<T> _) {
|
| + subscription = this.listen(((__x51) => DEVC$RT.cast(__x51, __t23, DEVC$RT.type((__t48<T> _) {
|
| }
|
| - ), "WrapLiteral", """line 733, column 7 of dart:async/stream.dart: """, __x62 is __t58<T>))((_) {
|
| + ), "InferableClosure", """line 733, column 7 of dart:async/stream.dart: """, __x51 is __t48<T>, false))((_) {
|
| _cancelAndValue(subscription, future, false);
|
| }
|
| ), onError: future._completeError, onDone: () {
|
| @@ -519,7 +479,7 @@ part of dart.async;
|
| _cancelAndValue(subscription, future, value);
|
| }
|
| }
|
| - , ((__x63) => DEVC$RT.cast(__x63, dynamic, __t48, "CompositeCast", """line 1036, column 11 of dart:async/stream.dart: """, __x63 is __t48, false))(_cancelAndErrorClosure(subscription, future)));
|
| + , ((__x52) => DEVC$RT.cast(__x52, dynamic, __t39, "CompositeCast", """line 1036, column 11 of dart:async/stream.dart: """, __x52 is __t39, false))(_cancelAndErrorClosure(subscription, future)));
|
| }
|
| , onError: future._completeError, onDone: () {
|
| if (defaultValue != null) {
|
| @@ -549,7 +509,7 @@ part of dart.async;
|
| result = value;
|
| }
|
| }
|
| - , ((__x64) => DEVC$RT.cast(__x64, dynamic, __t48, "CompositeCast", """line 1077, column 11 of dart:async/stream.dart: """, __x64 is __t48, false))(_cancelAndErrorClosure(subscription, future)));
|
| + , ((__x53) => DEVC$RT.cast(__x53, dynamic, __t39, "CompositeCast", """line 1077, column 11 of dart:async/stream.dart: """, __x53 is __t39, false))(_cancelAndErrorClosure(subscription, future)));
|
| }
|
| , onError: future._completeError, onDone: () {
|
| if (foundResult) {
|
| @@ -588,7 +548,7 @@ part of dart.async;
|
| result = value;
|
| }
|
| }
|
| - , ((__x65) => DEVC$RT.cast(__x65, dynamic, __t48, "CompositeCast", """line 1129, column 11 of dart:async/stream.dart: """, __x65 is __t48, false))(_cancelAndErrorClosure(subscription, future)));
|
| + , ((__x54) => DEVC$RT.cast(__x54, dynamic, __t39, "CompositeCast", """line 1129, column 11 of dart:async/stream.dart: """, __x54 is __t39, false))(_cancelAndErrorClosure(subscription, future)));
|
| }
|
| , onError: future._completeError, onDone: () {
|
| if (foundResult) {
|
| @@ -632,13 +592,13 @@ part of dart.async;
|
| void onData(T event) {
|
| timer.cancel();
|
| controller.add(event);
|
| - timer = zone.createTimer(timeLimit, DEVC$RT.cast(timeout, Function, __t66, "CompositeCast", """line 1219, column 43 of dart:async/stream.dart: """, timeout is __t66, false));
|
| + timer = zone.createTimer(timeLimit, DEVC$RT.cast(timeout, Function, __t55, "CompositeCast", """line 1219, column 43 of dart:async/stream.dart: """, timeout is __t55, false));
|
| }
|
| void onError(error, StackTrace stackTrace) {
|
| timer.cancel();
|
| assert (controller is _StreamController || controller is _BroadcastStreamController); var eventSink = controller;
|
| eventSink._addError(error, stackTrace);
|
| - timer = zone.createTimer(timeLimit, DEVC$RT.cast(timeout, Function, __t66, "CompositeCast", """line 1227, column 43 of dart:async/stream.dart: """, timeout is __t66, false));
|
| + timer = zone.createTimer(timeLimit, DEVC$RT.cast(timeout, Function, __t55, "CompositeCast", """line 1227, column 43 of dart:async/stream.dart: """, timeout is __t55, false));
|
| }
|
| void onDone() {
|
| timer.cancel();
|
| @@ -653,11 +613,7 @@ part of dart.async;
|
| ;
|
| }
|
| else {
|
| - onTimeout = ((__x70) => DEVC$RT.wrap((dynamic f(dynamic __u67)) {
|
| - dynamic c(dynamic x0) => f(x0);
|
| - return f == null ? null : c;
|
| - }
|
| - , __x70, __t28, __t68, "Wrap", """line 1245, column 21 of dart:async/stream.dart: """, __x70 is __t68))(zone.registerUnaryCallback(onTimeout));
|
| + onTimeout = ((__x58) => DEVC$RT.cast(__x58, __t23, __t56, "CompositeCast", """line 1245, column 21 of dart:async/stream.dart: """, __x58 is __t56, false))(zone.registerUnaryCallback(onTimeout));
|
| _ControllerEventSinkWrapper wrapper = new _ControllerEventSinkWrapper(null);
|
| timeout = () {
|
| wrapper._sink = controller;
|
| @@ -667,7 +623,7 @@ part of dart.async;
|
| ;
|
| }
|
| subscription = this.listen(onData, onError: onError, onDone: onDone);
|
| - timer = zone.createTimer(timeLimit, DEVC$RT.cast(timeout, Function, __t66, "CompositeCast", """line 1256, column 43 of dart:async/stream.dart: """, timeout is __t66, false));
|
| + timer = zone.createTimer(timeLimit, DEVC$RT.cast(timeout, Function, __t55, "CompositeCast", """line 1256, column 43 of dart:async/stream.dart: """, timeout is __t55, false));
|
| }
|
| Future onCancel() {
|
| timer.cancel();
|
| @@ -681,7 +637,7 @@ part of dart.async;
|
| }
|
| , () {
|
| subscription.resume();
|
| - timer = zone.createTimer(timeLimit, DEVC$RT.cast(timeout, Function, __t66, "CompositeCast", """line 1275, column 53 of dart:async/stream.dart: """, timeout is __t66, false));
|
| + timer = zone.createTimer(timeLimit, DEVC$RT.cast(timeout, Function, __t55, "CompositeCast", """line 1275, column 53 of dart:async/stream.dart: """, timeout is __t55, false));
|
| }
|
| , onCancel);
|
| return controller.stream;
|
| @@ -741,15 +697,15 @@ _sink.addError(error, stackTrace);
|
| _sink.close();
|
| }
|
| }
|
| - typedef dynamic __t26<T>(T __u27);
|
| + typedef dynamic __t21<T>(T __u22);
|
| + typedef dynamic __t23(dynamic __u24);
|
| + typedef T __t26<T>(int __u27);
|
| typedef dynamic __t28(dynamic __u29);
|
| - typedef T __t32<T>(int __u33);
|
| - typedef dynamic __t34(dynamic __u35);
|
| - typedef EventSink<dynamic> __t38(EventSink<dynamic> __u39);
|
| - typedef EventSink<dynamic> __t40<T>(EventSink<T> __u41);
|
| - typedef void __t43(StreamSubscription<dynamic> __u44);
|
| - typedef void __t45<T>(StreamSubscription<T> __u46);
|
| - typedef dynamic __t48(dynamic __u49, StackTrace __u50);
|
| - typedef void __t58<T>(T __u59);
|
| - typedef void __t66();
|
| - typedef void __t68(EventSink<dynamic> __u69);
|
| + typedef EventSink<dynamic> __t31(EventSink<dynamic> __u32);
|
| + typedef EventSink<dynamic> __t33<T>(EventSink<T> __u34);
|
| + typedef void __t35(StreamSubscription<dynamic> __u36);
|
| + typedef void __t37<T>(StreamSubscription<T> __u38);
|
| + typedef dynamic __t39(dynamic __u40, StackTrace __u41);
|
| + typedef void __t48<T>(T __u49);
|
| + typedef void __t55();
|
| + typedef void __t56(EventSink<dynamic> __u57);
|
|
|