-
Notifications
You must be signed in to change notification settings - Fork 323
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
Review File/Data read and read_text warnings #5799
Conversation
e94f77a
to
5a4af70
Compare
|
||
## Indicates that the given file is corrupted, i.e. the data it contains | ||
is not in the expected format. | ||
Corrupted_Format (file : File) (message : Text) (cause : Any | Nothing = Nothing) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does Any not include Nothing? Just curious.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It does, you are correct.
We sometimes use the Any | Nothing
pattern to reinforce that a Nothing
value is allowed here and it has some a bit special meaning.
How I'd read this signature is that the cause
may or may not be present (| Nothing
) and it may be of Any
type (if it's present).
From typelevel perspective, just Any
would suffice, but this is supposed to serve as kind of documentation.
I'm open to revising this approach though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No I think it makes sense to write it this way.
9926016
to
29f7e61
Compare
Test warnings on file read encoding.
…heck to Enso File.
11eb902
to
adf499b
Compare
Pull Request Description
Closes #5113
Fixes a bug where read-only files would be overwritten if File.write was used in backup mode, and added tests to avoid such regression. To implement it, introduced a
is_writable
property onFile
.Important Notes
Checklist
Please include the following checklist in your PR:
Scala,
Java,
and
Rust
style guides.
./run ide build
and./run ide watch
.