effekt icon indicating copy to clipboard operation
effekt copied to clipboard

'import' feature of the REPL does not work properly when no module is defined (MS Windows)

Open timmy-newtron opened this issue 4 years ago • 3 comments

Importing a file helloWorld.effekt

def hello() = {
  println("Hello World!")
}

to the REPL using

import helloWorld

causes the REPL to load the file, however, as no module name is defined, the generated outputfile will have no name an thus, calling hello() in the REPL will fail, as no file helloWorld.js can be found. The following file, however, works perfectly fine:

module helloWorld

def hello() = {
  println("Hello World!")
}

Expected behavior: import should work the same in Windows and OSX/*nix. Attached: crash report of the above example. crashReport.txt

timmy-newtron avatar Jun 13 '20 08:06 timmy-newtron

@edding4500 Thanks for reporting! Can you double-check whether my latest commit resolves the issue for you?

b-studios avatar Jun 13 '20 12:06 b-studios

The issue resided in the inference for a default file name. I purposefully used a regex to split on both platforms to avoid the dependency on the (JVM) file system. However, my regex was flawed (TM).

b-studios avatar Jun 13 '20 12:06 b-studios

Did the build commands in sbt change? I'm not able to build the current master.

timmy-newtron avatar Jun 14 '20 19:06 timmy-newtron

Effekt on Windows is broken right now (#401), but this seems to have worked in v0.2.1 on Windows and in WSL. We can revisit this after #401 gets fixed, closing for now, feel free to reopen.

jiribenes avatar Mar 22 '24 08:03 jiribenes