enso-org / enso

Hybrid visual and textual functional programming.
https://enso.org
Apache License 2.0
7.34k stars 320 forks source link

Output Context is not enabled in the REPL #9034

Open radeusgd opened 6 months ago

radeusgd commented 6 months ago

As shown in the repro:

$ enso repl
> "foo".write (File.new "radeks_file.txt")
>>> (File C:\Users\DELL\AppData\Local\Temp\radeks_file_ensodryrun3483346897526735121.txt)

We can see that the write operation returns a dry-run file, meaning that the Context is not enabled.

I get the same behaviour without the launcher, i.e. running .\built-distribution\enso-engine-0.0.0-dev-windows-amd64\enso-0.0.0-dev\bin\enso --repl.

Interestingly, if I run a custom file with a REPL breakpoint:

from Standard.Base import all
import Standard.Base.Runtime.Debug

main =
    IO.println "Hello!"
    Debug.breakpoint

it actually works correctly:

$ enso run myrepl.enso
Hello!
> "foo".write (File.new "radeks_other_file.txt")
>>> (File X:\NBO\enso\radeks_other_file.txt)
radeusgd commented 6 months ago

I suspect that's because the runner's runRepl does not have .strictErrors(true) setting when creating the context.

Takeaways: