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

Unified Diff: sdk/lib/io/file_impl.dart

Issue 2848703003: Fix a batch of DDC SDK compile errors. (Closed)
Patch Set: Revise. Created 3 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sdk/lib/core/string.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/io/file_impl.dart
diff --git a/sdk/lib/io/file_impl.dart b/sdk/lib/io/file_impl.dart
index fd66fc1b6094de886ce9e268d819bb502b783fa3..d39e3c07a8ae80e3519507c97f6e4187ec1a2a4d 100644
--- a/sdk/lib/io/file_impl.dart
+++ b/sdk/lib/io/file_impl.dart
@@ -199,7 +199,7 @@ 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 +556,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);
« no previous file with comments | « sdk/lib/core/string.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698