Skip to content

Commit

Permalink
String is not Enso type, return Text
Browse files Browse the repository at this point in the history
  • Loading branch information
JaroslavTulach committed Mar 30, 2024
1 parent d3b135d commit 0e4f631
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import java.util.function.IntFunction;
import org.enso.interpreter.dsl.Builtin;
import org.enso.interpreter.runtime.EnsoContext;
import org.enso.interpreter.runtime.data.text.Text;
import org.enso.interpreter.runtime.data.vector.ArrayLikeHelpers;
import org.enso.interpreter.runtime.error.PanicException;
import org.enso.interpreter.runtime.library.dispatch.TypesLibrary;
Expand Down Expand Up @@ -174,8 +175,8 @@ public EnsoFile getAbsoluteFile() {

@Builtin.Method(name = "path")
@CompilerDirectives.TruffleBoundary
public String getPath() {
return this.truffleFile.getPath();
public Text getPath() {
return Text.create(this.truffleFile.getPath());
}

@Builtin.Method
Expand Down Expand Up @@ -228,9 +229,9 @@ public boolean isWritable() {

@Builtin.Method(name = "name")
@CompilerDirectives.TruffleBoundary
public String getName() {
public Text getName() {
var name = this.truffleFile.getName();
return name == null ? "/" : name;
return Text.create(name == null ? "/" : name);
}

@Builtin.Method(name = "size_builtin")
Expand Down

0 comments on commit 0e4f631

Please sign in to comment.