bug: error message of `Lean.Json.setObjVal!` lacks string formatting
Open
Beginner friendly
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}"
Impact
Add 👍 to issues you consider important. If others are impacted by this issue, please ask them to add 👍 to it.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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