8000 A `~` capture of a record field runs on BEAM, fails on the walker · Issue #775 · kexhq/kex · GitHub
[go: up one dir, main page]

Skip to content

A ~ capture of a record field runs on BEAM, fails on the walker #775

Open

Description

@akoskovacs

A ~ capture of a record field passes the checker and runs on BEAM, but the walker cannot find it.

record Item do
  done : Bool = false
end

main do
  IO.printLine([Item {}].all?(~done))
end
  • kex -C: No errors found.
  • kex (BEAM): prints false
  • kex -R: Internal error: :0:0: runtime error: Undefined function: done

The runtime error also has no source position (:0:0).

Expected: the backends agree. Either a field capture works on both (~done is { |item| item.done }), or the checker rejects it.

A name that is also a prelude function is a separate problem: ~name on a record with a name field resolves to Weekday.name (`name` expects argument 1 to be Weekday).

Found while extending tools/metamorphic.kex, whose spec used variants.all?(~rejectChanged).

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      0