From c3e815bc7ad488eddf00344ab4106485a9d1ba32 Mon Sep 17 00:00:00 2001 From: Brian Quinlan Date: Mon, 22 May 2023 23:37:31 +0000 Subject: [PATCH] [io] Make FileSystemEvent sealed Bug: https://github.com/dart-lang/sdk/issues/52027, https://github.com/dart-lang/sdk/issues/51912 Change-Id: I154ffe5901e4248f48400e6c84568c9fe6dbcd83 CoreLibraryReviewExempt: aske on holiday Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/302452 Reviewed-by: Sigmund Cherem Commit-Queue: Brian Quinlan Reviewed-by: Lasse Nielsen Reviewed-by: Siva Annamalai --- CHANGELOG.md | 5 +++++ sdk/lib/io/file_system_entity.dart | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 40951feccfc..a8e791d9376 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,17 +10,22 @@ current directory ([#39796][]). [#39796]: https://darbug.com/39796 + #### `dart:io` - **Breaking change** [#51486][]: - Added `sameSite` to the `Cookie` class. - Added class `SameSite`. +- **Breaking change** [#52027][]: `FileSystemEvent` is + [`sealed`](https://dart.dev/language/class-modifiers#sealed). This means + that `FileSystemEvent` cannot be extended or implemented. - Added a deprecation warning when `Platform` is instantiated. - Added `Platform.lineTerminator` which exposes the character or characters that the operating system uses to separate lines of text, e.g., `"\r\n"` on Windows. [#51486]: https://github.com/dart-lang/sdk/issues/51486 +[#52027]: https://github.com/dart-lang/sdk/issues/52027 ### Other libraries diff --git a/sdk/lib/io/file_system_entity.dart b/sdk/lib/io/file_system_entity.dart index 23eba4d313c..77de06dc1fc 100644 --- a/sdk/lib/io/file_system_entity.dart +++ b/sdk/lib/io/file_system_entity.dart @@ -876,7 +876,7 @@ abstract class FileSystemEntity { } /// Base event class emitted by [FileSystemEntity.watch]. -final class FileSystemEvent { +sealed class FileSystemEvent { /// Bitfield for [FileSystemEntity.watch], to enable [FileSystemCreateEvent]s. static const int create = 1 << 0;