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

Side by Side Diff: test/dart_codegen/expect/convert/converter.dart

Issue 1038583004: Rationalize coercions (Closed) Base URL: https://github.com/dart-lang/dev_compiler.git@master
Patch Set: Rebase 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.convert; 1 part of dart.convert;
2 abstract class Converter<S, T> implements StreamTransformer {const Converter(); 2 abstract class Converter<S, T> implements StreamTransformer {const Converter();
3 T convert(S input); 3 T convert(S input);
4 Converter<S, dynamic> fuse(Converter<T, dynamic> other) { 4 Converter<S, dynamic> fuse(Converter<T, dynamic> other) {
5 return new _FusedConverter<S, T, dynamic>(this, other); 5 return new _FusedConverter<S, T, dynamic>(this, other);
6 } 6 }
7 ChunkedConversionSink startChunkedConversion(Sink sink) { 7 ChunkedConversionSink startChunkedConversion(Sink sink) {
8 throw new UnsupportedError("This converter does not support chunked conversion s: $this"); 8 throw new UnsupportedError("This converter does not support chunked conversion s: $this");
9 } 9 }
10 Stream bind(Stream source) { 10 Stream bind(Stream source) {
11 return new Stream.eventTransformed(source, (EventSink sink) => new _ConverterS treamEventSink(this, sink)); 11 return new Stream.eventTransformed(source, (EventSink sink) => new _ConverterS treamEventSink(this, sink));
12 } 12 }
13 } 13 }
14 class _FusedConverter<S, M, T> extends Converter<S, T> {final Converter _first; 14 class _FusedConverter<S, M, T> extends Converter<S, T> {final Converter _first;
15 final Converter _second; 15 final Converter _second;
16 _FusedConverter(this._first, this._second); 16 _FusedConverter(this._first, this._second);
17 T convert(S input) => ((__x4) => DEVC$RT.cast(__x4, dynamic, T, "CastGeneral", """line 58, column 25 of dart:convert/converter.dart: """, __x4 is T, false))(_s econd.convert(_first.convert(input))); 17 T convert(S input) => ((__x4) => DEVC$RT.cast(__x4, dynamic, T, "CompositeCast" , """line 58, column 25 of dart:convert/converter.dart: """, __x4 is T, false))( _second.convert(_first.convert(input)));
18 ChunkedConversionSink startChunkedConversion(Sink sink) { 18 ChunkedConversionSink startChunkedConversion(Sink sink) {
19 return _first.startChunkedConversion(_second.startChunkedConversion(sink)); 19 return _first.startChunkedConversion(_second.startChunkedConversion(sink));
20 } 20 }
21 } 21 }
OLDNEW
« no previous file with comments | « test/dart_codegen/expect/convert/codec.dart ('k') | test/dart_codegen/expect/convert/encoding.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698