Skip to content
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

Remove File from File./ #9330

Merged
merged 3 commits into from
Mar 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -627,6 +627,7 @@
directly)][9269]
- [Added `Xml_Document.write`][9299]
- [Added `select_by_type` and `remove_by_type` to `Table` and `DB_Table`][9334]
- [Make File./ only accept Text][9330]

[debug-shortcuts]:
https://github.com/enso-org/enso/blob/develop/app/gui/docs/product/shortcuts.md#debug
Expand Down Expand Up @@ -909,6 +910,7 @@
[9269]: https://github.com/enso-org/enso/pull/9269
[9299]: https://github.com/enso-org/enso/pull/9299
[9344]: https://github.com/enso-org/enso/pull/9344
[9330]: https://github.com/enso-org/enso/pull/9330

#### Enso Compiler

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -339,8 +339,8 @@ type File

example_append = Examples.data_dir / "scratch_file"
@subpath get_child_widget
/ : (Text | File) -> File
/ self subpath = self.resolve subpath
/ : Text -> File
/ self (subpath : Text) = self.resolve subpath

## GROUP Calculations
ICON folder
Expand Down Expand Up @@ -371,7 +371,7 @@ type File
## PRIVATE
Internal method to join two path segments together.
resolve : Text -> File
resolve self subpath = @Builtin_Method "File.resolve"
resolve self (subpath : Text) = @Builtin_Method "File.resolve"

## PRIVATE
Convert the file descriptor to a JS_Object.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,12 +123,6 @@ public EnsoFile resolve(String subPath) {
return new EnsoFile(this.truffleFile.resolve(subPath));
}

@Builtin.Method(name = "resolve")
@Builtin.Specialize
public EnsoFile resolve(EnsoFile subPath) {
return new EnsoFile(this.truffleFile.resolve(subPath.truffleFile.getPath()));
}

@Builtin.Method
public boolean exists() {
return truffleFile.exists();
Expand Down
Loading