8000 A module's private name is accepted after `using`, and the backends disagree · Issue #781 · kexhq/kex · GitHub
[go: up one dir, main page]

Skip to content

A module's private name is accepted after using, and the backends disagree #781

Open

Description

@akoskovacs

using brings a module's private names into scope as far as the checker is concerned. The walker then cannot find the name, and BEAM finds it.

module Config do
  private do
    let secret = 5
  end
end

using Config

main do
  IO.printLine(secret)
end
  • kex -C: No errors found.
  • kex -R: runtime error: undefined variable: secret
  • kex (BEAM): prints 5

Config.secret is rejected, as expected. Expected the bare name after using to be rejected the same way, with KEXET-0149 (secret` is private to `Config).

Seen on kex 0.4.0-rc.4 built from main at 371bbdf. Found while writing explanations for oops.kex.run.

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 workingModules

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      0