Skip to content

[P2] String coercion exposes inline-versus-heap storage #17

Closed

Description

@ymote

Reproduced during the 2026-09-04 language review at a20753c6cff96ee86758744e227a04460234a832. Priority: P2.

["2" > 1, "00000002" > 1]

Observed result: [false, true]. Individually, "2" - 1 yields NaN, "12345678" - 1 yields 12345677, and "abcdefgh" - 1 yields -1.

cast_to_f64 parses heap strings and substitutes zero on parsing failure, but does not handle inline strings through the same path. Thus semantically related input changes behavior when its representation changes. An invalid string can participate in arithmetic as zero without an error; a short string can instead create a non-finite result that fails much later at a JSON boundary.

For a small generated-dataflow language, strict numeric operands are easier to audit. Provide an explicit conversion with a defined invalid-input result if string-to-number conversion is needed. If coercion is retained, it must be uniform across string representations and must have a published failure policy. Do not preserve a storage accident as the language contract.

Acceptance: implement the described correction, publish the resulting language contract, and add focused regression coverage including applicable capability, streaming-parser, and resource-limit cases.

Fix and executable regressions: PR #19. Workspace tests, explicit vendor suites, formatting, strict Clippy, and the Linux ARM64/RISC-V and Windows GNU compile checks pass locally. All GitHub Actions checks pass on f1e775f, including Linux tests, fuzzing, AddressSanitizer, and Miri. This issue remains open until the fix is merged.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions