Outcome printer formats the bigint sign by hand instead of `Bigint_utils.to_string`
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 78/100
- Issue type
- Refactor
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- ocaml
- Domain
- compilers
Research direction
Start at the bigint constant case in compiler/syntax/src/res_outcome_printer.ml around lines 486-487, where the sign and digits are joined by hand. Compare it with Bigint_utils.to_string in compiler/ml/bigint_utils.ml, and check how res_core.ml already calls Bigint_utils from the syntax library. Done when the printer calls the shared helper, the hand-written sign logic is gone, and printed output is unchanged for positive and negative bigints.
Written by the indexing model from the issue text.
Description
Found by differential semantic drift analysis from ece8b148 to a7721303.
What is broken
res_outcome_printer.ml L486-L487 formats a bigint constant by hand: (if positive then "" else "-") ^ digits ^ "n". The same logic exists as Bigint_utils.to_string, used by printlambda.ml and printtyped.ml. #8732 fixed a sign bug in exactly this hand-written copy. The syntax library already depends on ml and uses Bigint_utils (res_core.ml), so the printer can call the shared helper and keep one definition of the sign convention.
Possible cause (speculation only)
A guess: the fix in #8732 corrected the copy in place, the smallest change, rather than replacing it with the shared helper.
- Dominant language
- OCaml
- Stars
- 7.5k
- Forks
- 484
- Avg merge
- 19h 46m
- Merged PRs (30d)
- 81
Getting set up
Starts the project's dev container in your browser, under your own GitHub account.
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing 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.
More from rescript-lang/rescript
-
Difficulty 3/5 Half a day Newbie friendliness 58/100
rescript-lang/rescript#8757 ·
Maintainers usually reply within 1 day
-
Difficulty 3/5 1-2 days Newbie friendliness 40/100
rescript-lang/rescript#8753 ·
Maintainers usually reply within 1 day
-
Difficulty 5/5 Over a week Newbie friendliness 22/100
rescript-lang/rescript#8733 ·
Maintainers usually reply within 1 day
-
Difficulty 5/5 Over a week Newbie friendliness 35/100
rescript-lang/rescript#8727 ·
Maintainers usually reply within 1 day
-
Difficulty 5/5 Over a week Newbie friendliness 35/100
rescript-lang/rescript#8726 ·
Maintainers usually reply within 1 day
All issues in rescript-lang/rescript
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
bytecodealliance/wasm-tools#2768 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
objectionary/jeo-maven-plugin#1898 ·
Maintainers usually reply within 2 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day