-
Notifications
You must be signed in to change notification settings - Fork 16
Open
Labels
questionFurther information is requested / neededFurther information is requested / needed📁 ./rtChanges and additions to the runtimeChanges and additions to the runtime
Milestone
Description
Consider the following (minimised) version of the unit testing library I've been writing
(** FILE: lib/Unit.trp *)
let
(*--- Pretty Printing ---*)
fun yellow s = "\x1b[33m" ^ s ^ "\x1b[0m"
val testStr = yellow "[ TEST ] "
(*--- Test Creation ---*)
fun foo _ = 42
(*--- Module ---*)
val Unit = {
foo = foo
}
in [ ("Unit", Unit) ]
endimported as follows
(** FILE: test/lib/Unit.trp *)
import Unit
let val _ = Unit.foo
in 0
endAt runtime, the import breaks with the following error
file:///troupe/rt/built/loadLibsAsync.mjs:41
let table = libinstance.export({ __dataLevel: levels.BOT }).val.toArray();
^
TypeError: Cannot read properties of undefined (reading 'toArray')
at loadLibsAsync (file:///home/soelvsten/git/postdoc/troupe/rt/built/loadLibsAsync.mjs:41:72)
at async UserRuntimeZero.linkLibs (file:///home/soelvsten/git/postdoc/troupe/rt/built/builtins/UserRuntimeZero.mjs:228:9)
at async start (file:///home/soelvsten/git/postdoc/troupe/rt/built/runtimeMonitored.mjs:397:5)
As far as we can tell, the library is compiled into a closure rather than as a list exported values.
Metadata
Metadata
Assignees
Labels
questionFurther information is requested / neededFurther information is requested / needed📁 ./rtChanges and additions to the runtimeChanges and additions to the runtime