Serialize writes a StringSet to std_formatter instead of the supplied formatter
Nobody has claimed this yet.
Assessment
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Newbie friendliness
- 92/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- ocaml
- Domain
- tooling
Research direction
Start in lib/serialize.ml:26-28 and compare this printer with the corrected printers in lib/value.ml and lib/solverAst.ml from #35. Run the repro in test/test_cases/sets.gbl and verify that formatting a term containing a StringSet keeps the set inside the supplied formatter output without stray terminal output.
Written by the indexing model from the issue text.
Description
lib/serialize.ml:26-28:
| Leaf (StringSet s) ->
Format.fprintf Format.std_formatter "{%a}"
(Lib.pp_print_list Format.pp_print_string ", ") (Utils.StringSet.to_list s)
It ignores ppf and writes to stdout, so Format.asprintf on a term containing a set silently drops the set from the result and prints it to the terminal instead.
Repro
test/test_cases/sets.gbl:
$ goblin --file sets.gbl --seed 42
{, a}(S@{0}[0] (Names@{0}[0] (set.union (set.singleton "") (set.singleton "a"))) (Chosen@{0}[0] ""))
The leading {, a} is the stray write; it appears before the term rather than inside it.
Notes
- Pre-existing: identical on
9c1f1e9. - The same bug was fixed in
lib/value.mlandlib/solverAst.mlin #35 (two printers that wrote tostd_formatterregardless of the suppliedppf); this is the one remaining instance of that pattern.
- Dominant language
- OCaml
- Stars
- 0
- Forks
- 1
- Avg merge
- 1h 57m
- Merged PRs (30d)
- 2
Contributor guide
No contributing guide indexed for this repository
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.
More from lorchrob/Goblin
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
-
Difficulty 4/5 3-5 days Newbie friendliness 45/100
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
help wanted
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
hemilabs/ui-monorepo#2332 ·
-
Help-Wanted Needs-Triage Package-Update
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
microsoft/winget-pkgs#438662 ·
-
priority: p3
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
googleapis/librarian#7636 ·
-
bug good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
olcf/olcf-test-harness#278 · 1 comment ·