Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Add a non-noPos call position to primops #10597

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

roberth
Copy link
Member

@roberth roberth commented Apr 23, 2024

Motivation

Pass a Pos to primops, so that warn can print a position.

Notably, the position works well with partial application, such as here:

let
  warnIf = c: s: if c then builtins.warn s else null;
in
  builtins.warn "hI"
  (warnIf true "ok" 1213)

Both warning calls print their most relevant position.

TODO:

  • The simple change of forwarding pos caused a number of duplicate positions to be printed. The deduplication isn't quite done.

Context

Priorities and Process

Add 馃憤 to pull requests you find important.

The Nix maintainer team uses a GitHub project board to schedule and track reviews.

Constructing ErrorInfo is a little awkward for now, but this does
produce a richer log entry.
Need to do something about "from call site" without any info.

Should it print "(on same location)"?
@roberth roberth added error-messages Confusing messages and better diagnostics language The Nix expression language; parser, interpreter, primops, evaluation, etc labels Apr 23, 2024
@github-actions github-actions bot added the with-tests Issues related to testing. PRs with tests have some priority label Apr 23, 2024
@roberth roberth changed the title [WIP] Add call position to primops [WIP] Add a non-noPos call position to primops Apr 23, 2024
@roberth roberth mentioned this pull request Apr 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
error-messages Confusing messages and better diagnostics language The Nix expression language; parser, interpreter, primops, evaluation, etc with-tests Issues related to testing. PRs with tests have some priority
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant