This issue exists since at least v8.4.2 (the oldest version available in the playground).
The following code triggers error File "compiler/core/lam_compile_external_call.ml", line 424, characters 11-17: Assertion failed
:
@get
external foo: unit => string = "foo"
let x = foo()
Playground link
Relevant compiler code:
|
| Js_get {js_get_name = name; js_get_scopes = scopes} -> ( |
|
let args, cur_eff = assemble_args_no_splice arg_types args in |
|
add_eff cur_eff |
|
@@ |
|
match args with |
|
| [obj] -> |
|
let obj = translate_scoped_access scopes obj in |
|
E.dot obj name |
|
| _ -> assert false |
Not calling foo
compiles fine though:
@get
external foo: unit => string = "foo"