Add workarounds for sdk#33459 (#92)
diff --git a/packages/file/lib/src/backends/record_replay/recording_directory.dart b/packages/file/lib/src/backends/record_replay/recording_directory.dart
index d38abe9..6509da3 100644
--- a/packages/file/lib/src/backends/record_replay/recording_directory.dart
+++ b/packages/file/lib/src/backends/record_replay/recording_directory.dart
@@ -30,6 +30,28 @@
});
}
+ // These four abstract methods, [create], [createSync], [list], and [listSync],
+ // are implemented by [noSuchMethod], but their presence here works around
+ // https://github.com/dart-lang/sdk/issues/33459, allowing these methods to
+ // be called within a Dart 2 runtime.
+ // TODO(srawlins): Remove these when the minimum SDK version in
+ // `pubspec.yaml` contains a fix for
+ // https://github.com/dart-lang/sdk/issues/33459.
+
+ @override
+ Future<Directory> create({bool recursive: false});
+
+ @override
+ void createSync({bool recursive: false});
+
+ @override
+ Stream<FileSystemEntity> list(
+ {bool recursive: false, bool followLinks: true});
+
+ @override
+ List<FileSystemEntity> listSync(
+ {bool recursive: false, bool followLinks: true});
+
@override
Directory wrap(Directory delegate) =>
super.wrap(delegate) ?? wrapDirectory(delegate);
diff --git a/packages/file/lib/src/backends/record_replay/recording_proxy_mixin.dart b/packages/file/lib/src/backends/record_replay/recording_proxy_mixin.dart
index b95d5ed..52fd9db 100644
--- a/packages/file/lib/src/backends/record_replay/recording_proxy_mixin.dart
+++ b/packages/file/lib/src/backends/record_replay/recording_proxy_mixin.dart
@@ -194,4 +194,25 @@
}
return result;
}
+
+ // These four abstract methods, [delete], [deleteSync], [typeSync], and
+ // [watch], are implemented by [noSuchMethod], but their presence here works
+ // around https://github.com/dart-lang/sdk/issues/33459, allowing these
+ // methods to be called within a Dart 2 runtime.
+ // TODO(srawlins): Remove these when the minimum SDK version in
+ // `pubspec.yaml` contains a fix for
+ // https://github.com/dart-lang/sdk/issues/33459.
+
+ @override
+ Future<FileSystemEntity> delete({bool recursive: false});
+
+ @override
+ void deleteSync({bool recursive: false});
+
+ @override
+ FileSystemEntityType typeSync(String path, {bool followLinks: true});
+
+ @override
+ Stream<FileSystemEvent> watch(
+ {int events: FileSystemEvent.all, bool recursive: false});
}