Skip to content

Fix exponent-form doubles in static artifacts - #16

Merged
ademar merged 1 commit into
masterfrom
cursor/critical-bug-management-3e56
Jul 25, 2026
Merged

Fix exponent-form doubles in static artifacts#16
ademar merged 1 commit into
masterfrom
cursor/critical-bug-management-3e56

Conversation

@cursor

@cursor cursor Bot commented Jul 25, 2026

Copy link
Copy Markdown

Bug

Managed and NativeAOT artifact generation emitted exponent-form doubles such as 1E+20 as 1E+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

  • Targeted exponent artifact test passes
  • Full Release suite passes: 225 tests
Open in Web View Automation 

View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with 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).

StaticCompiler now centralizes double emission in doubleLiteral: non-finite values use System.Double.NaN / PositiveInfinity / NegativeInfinity, and finite values without a decimal point get .0 before the E/e exponent (so 1E+20 instead of invalid 1E+20.0). A new CLI regression test compiles 1e20 to 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.

Co-authored-by: Ademar Gonzalez <ademar@users.noreply.github.com>
@ademar
ademar marked this pull request as ready for review July 25, 2026 12:00
@cursor

cursor Bot commented Jul 25, 2026

Copy link
Copy Markdown
Author

Bugbot couldn't run - usage limit reached

Bugbot 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)

@ademar
ademar merged commit 4cecc6e into master Jul 25, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants