| Index: sdk/lib/io/file_impl.dart
|
| diff --git a/sdk/lib/io/file_impl.dart b/sdk/lib/io/file_impl.dart
|
| index 668889293a99548c08afcc842104228631b3deb0..ab942f337b9961a74ca54bd8dcf25d6d08697e42 100644
|
| --- a/sdk/lib/io/file_impl.dart
|
| +++ b/sdk/lib/io/file_impl.dart
|
| @@ -199,7 +199,9 @@ class _FileStreamConsumer extends StreamConsumer<List<int>> {
|
| }
|
|
|
| Future<File> close() =>
|
| - _openFuture.then<File>((openedFile) => openedFile.close());
|
| + _openFuture
|
| + .then((openedFile) => openedFile.close())
|
| + .then((_) => _file);
|
| }
|
|
|
| // Class for encapsulating the native implementation of files.
|
| @@ -556,7 +558,7 @@ class _File extends FileSystemEntity implements File {
|
| Future<File> writeAsBytes(List<int> bytes,
|
| {FileMode mode: FileMode.WRITE, bool flush: false}) {
|
| return open(mode: mode).then((file) {
|
| - return file.writeFrom(bytes, 0, bytes.length).then((_) {
|
| + return file.writeFrom(bytes, 0, bytes.length).then<File>((_) {
|
| if (flush) return file.flush().then((_) => this);
|
| return this;
|
| }).whenComplete(file.close);
|
|
|