Fix exponent-form doubles in static artifacts - #16
Merged
Conversation
Co-authored-by: Ademar Gonzalez <ademar@users.noreply.github.com>
ademar
marked this pull request as ready for review
July 25, 2026 12:00
Author
Bugbot couldn't run - usage limit reachedBugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit. A user or team admin can review and increase usage limits in the Cursor dashboard. (requestId: serverGenReqId_f5c89d89-a1a5-4b64-bc63-d7ee156481bd) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Bug
Managed and NativeAOT artifact generation emitted exponent-form doubles such as
1E+20as1E+20.0, which is invalid F#. Any source containing a sufficiently large or small ordinary double therefore failed artifact compilation.Fix
Insert the required decimal marker before the exponent and emit valid constants for non-finite doubles. Add an end-to-end managed artifact regression test that compiles and runs
1e20.Validation
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.Note
Low Risk
Localized change to static literal emission in the compiler plus a test; no runtime eval or security paths affected.
Overview
Fixes managed artifact compilation when programs embed doubles that round-trip as exponent notation (e.g.
1e20).StaticCompilernow centralizes double emission indoubleLiteral: non-finite values useSystem.Double.NaN/PositiveInfinity/NegativeInfinity, and finite values without a decimal point get.0before theE/eexponent (so1E+20instead of invalid1E+20.0). A new CLI regression test compiles1e20to a managed artifact and asserts runtime output<obj 1E+20 : Double>.Reviewed by Cursor Bugbot for commit f4dbea2. Bugbot is set up for automated code reviews on this repo. Configure here.