8000 `Env.get` reports an error inside stdlib env.kex instead of the call site · Issue #562 · kexhq/kex · GitHub
[go: up one dir, main page]

Skip to content

Env.get reports an error inside stdlib env.kex instead of the call site #562

Open

Description

@akoskovacs

Writing Env.get (instead of the env capability, or ENV) blames the stdlib, not the user's code:

main do
  IO.printLine(Env.get("HOME").or("?"))
end
../../src/stdlib/env.kex:25:1: error: this file is `Env` by its path, but declares `ENV`; name it `module Env`

The error points at src/stdlib/env.kex and tells the user to rename a stdlib module. It should say that Env is not a module, and suggest main(args, env) → env.get(...) (or ENV). It looks like Env. triggers a path-based module lookup that finds env.kex and then fails the file-name/module-name consistency check on it.

Activity

  1. akoskovacs commented on Oct 24, 2026

    @akoskovacs
    CollaboratorAuthor

    Confirmed on main (fc2586f), both backends: IO.printLine(Env.get("HOME").or("?")) in main reports src/stdlib/env.kex:25:1: error: this file is Envby its path, but declaresENV; name it module Env`` instead of an error at the call site.

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 workingConfirmed IssueBug is reproduced on the current development versionTypechecker

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      0