-
Notifications
You must be signed in to change notification settings - Fork 1.7k
[breaking change] Make dart:io
FileSystemEvent
sealed
in Dart 3.1
#52027
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Is this really breaking? I thought |
My reading of the version section of the class modifiers design is that |
Oh! This is also a cherry-pick, right? I lean towards LGTM, but I'd like thoughts from @mit-mit |
dart:io
FileSystemEvent
sealed
dart:io
FileSystemEvent
sealed
in Dart 3.1
This isn't a cherry-pick...I'd like the change to be made in Dart 3.1 I was planning on making |
Fine by me (in particular because this doesn't seem to hurt anyone doing testing). |
lgtm |
LGTM |
Bug: #52027, #51912 Change-Id: I154ffe5901e4248f48400e6c84568c9fe6dbcd83 CoreLibraryReviewExempt: aske on holiday Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/302452 Reviewed-by: Sigmund Cherem <[email protected]> Commit-Queue: Brian Quinlan <[email protected]> Reviewed-by: Lasse Nielsen <[email protected]> Reviewed-by: Siva Annamalai <[email protected]>
@brianquinlan What is the status of the fix for I think we will need to update the version of
|
@elliette can you run a |
(this would still be breaking for anybody on an older version of watcher though) |
It appears that there were two breaks that appeared at roughly the same time and we misdiagnosed this change as the cause for the other issue. Jake is right, running a |
Change Intent
Make
FileSystemEvent
sealed
starting in Dart 3.1.Justification
It would be nice to be able to exhaustively pattern match on the events produced by
FileSystemEntity.watch
soFileSystemEvent
should be sealed.Impact
Code targeting Dart 2 will not be able to
implements
orextends
FileSystemEvent
(FileSystemEvent
isfinal
so Dart 3 code already cannotimplement
orextend
it).The only known package that
implements
aFileSystemEvent
ispackage:watcher
, which I will fix.In Dart 3.0.0, the constructors for
FileSystemEvent
subclasses are public so the only obvious reason for implementing aFileSystemEvent
is gone.Mitigation
Code that
implements
orextends
FileSystemEvent
will need to be modified but the modification is straightforward i.e. use the new public constructors for those classes instead of creating your own subclasses.The text was updated successfully, but these errors were encountered: