8000 `BEAM.` calls pass the checker and fail under `-R` as `undefined function: BEAM.lists` · Issue #754 · kexhq/kex · GitHub
[go: up one dir, main page]

Skip to content

BEAM. calls pass the checker and fail under -R as undefined function: BEAM.lists #754

Open

Description

@akoskovacs

A BEAM. foreign call passes kex -C and then fails at run time under the interpreter, reported as an internal error:

main do
  IO.printLine(BEAM.lists.reverse([1, 2, 3]))
end
$ kex -C ffi.kex
No errors found.
$ kex ffi.kex
[3, 2, 1]
$ kex -R ffi.kex
Internal error: ffi.kex:2:26: runtime error: undefined function: BEAM.lists

BEAM. is BEAM-only by design, but the message reads like a missing function. Expected: under -R (and in the wasm REPL), a clear error saying BEAM. calls need the BEAM backend, ideally at check time when the walker is the target, so the program is refused before it runs.

Seen on 0.4.0-rc.4 (0292db50), macOS arm64, OTP 29.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      0