From e66a38c39560a6f5253bfa7bf23ef8f3fbe76788 Mon Sep 17 00:00:00 2001 From: Adam Riley Date: Mon, 11 Mar 2024 09:23:42 +0000 Subject: [PATCH 1/3] Remove File from File./ --- distribution/lib/Standard/Base/0.0.0-dev/src/System/File.enso | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/distribution/lib/Standard/Base/0.0.0-dev/src/System/File.enso b/distribution/lib/Standard/Base/0.0.0-dev/src/System/File.enso index a8e6ff074eb7..3c3bfade6232 100644 --- a/distribution/lib/Standard/Base/0.0.0-dev/src/System/File.enso +++ b/distribution/lib/Standard/Base/0.0.0-dev/src/System/File.enso @@ -339,7 +339,7 @@ type File example_append = Examples.data_dir / "scratch_file" @subpath get_child_widget - / : (Text | File) -> File + / : Text -> File / self subpath = self.resolve subpath ## GROUP Calculations From 7f1550eb95ce33f30f2c5b9f4d6b0f7ca86c89b0 Mon Sep 17 00:00:00 2001 From: Adam Riley Date: Mon, 11 Mar 2024 09:24:10 +0000 Subject: [PATCH 2/3] Added Changelog --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index c96943ed8379..055b435808cb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 @@ -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 From 7f895614aa03876f540390170a62a5dffa7cfb9a Mon Sep 17 00:00:00 2001 From: Adam Riley Date: Mon, 11 Mar 2024 09:24:10 +0000 Subject: [PATCH 3/3] Code Review changes --- .../lib/Standard/Base/0.0.0-dev/src/System/File.enso | 4 ++-- .../java/org/enso/interpreter/runtime/data/EnsoFile.java | 6 ------ 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/distribution/lib/Standard/Base/0.0.0-dev/src/System/File.enso b/distribution/lib/Standard/Base/0.0.0-dev/src/System/File.enso index 3c3bfade6232..37a62b71a3b1 100644 --- a/distribution/lib/Standard/Base/0.0.0-dev/src/System/File.enso +++ b/distribution/lib/Standard/Base/0.0.0-dev/src/System/File.enso @@ -340,7 +340,7 @@ type File example_append = Examples.data_dir / "scratch_file" @subpath get_child_widget / : Text -> File - / self subpath = self.resolve subpath + / self (subpath : Text) = self.resolve subpath ## GROUP Calculations ICON folder @@ -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. diff --git a/engine/runtime/src/main/java/org/enso/interpreter/runtime/data/EnsoFile.java b/engine/runtime/src/main/java/org/enso/interpreter/runtime/data/EnsoFile.java index e15951d5be40..6ba761e47c0b 100644 --- a/engine/runtime/src/main/java/org/enso/interpreter/runtime/data/EnsoFile.java +++ b/engine/runtime/src/main/java/org/enso/interpreter/runtime/data/EnsoFile.java @@ -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();