leanprover / leanprover/lean4

bug: error message of `Lean.Json.setObjVal!` lacks string formatting

Open Beginner friendly
#7,307 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug P-low
Dominant language
Lean
Stars
9.2k
Forks
990
Avg merge
1d 17h
Merged PRs (30d)
175

Description

I noticed that the panic! message in Lean.Json.setObjVal! seems to miss an s! for propper String formatting:

def setObjVal! : Json → String → Json → Json
  | obj kvs, k, v => obj <| kvs.insert compare k v
  | _      , _, _ => panic! "Json.setObjVal!: not an object: {j}"

source code

Impact

Add 👍 to issues you consider important. If others are impacted by this issue, please ask them to add 👍 to it.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in src/Lean/Data/Json/Basic.lean around Lean.Json.setObjVal! and inspect the panic! message formatting. Confirm the behavior for a non-object JSON value, then make the message render the value correctly and verify that the resulting error no longer shows an unformatted placeholder.

Written by the indexing model from the issue text.

Assessment

Domain
compilers
Issue type
Bug
Difficulty
1/5
Estimated time
Under an hour
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
62/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.