Skip to content

Add regression fix for numeric string concatenation#366

Open
Richtermeister wants to merge 2 commits into
flosch:masterfrom
TheDMSGroup:bugfix-342
Open

Add regression fix for numeric string concatenation#366
Richtermeister wants to merge 2 commits into
flosch:masterfrom
TheDMSGroup:bugfix-342

Conversation

@Richtermeister

Copy link
Copy Markdown
Contributor

This is a fix for #342

@sonarqubecloud

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
21.0% Duplication on New Code (required ≤ 3%)

See analysis details on SonarQube Cloud

@Richtermeister

Copy link
Copy Markdown
Contributor Author

@flosch Hi Florian, please let me know if the SonarCube check is a showstopper here.. seems like it's caused by continuing an existing pattern in the codebase, not sure it's worth trying to prevent that type of code duplication, but happy to do so if you want.

Richtermeister and others added 2 commits June 7, 2026 07:43
The "+" fix for issue flosch#342 restored v4 behavior ("10" + 5 == 15), but
that flips the v5/v6 string-concatenation behavior ("10" + 5 == "105"),
which is itself a breaking change for current users.

Gate the arithmetic path behind a new Options.NumericStringArithmetic
flag (default false), so the v5/v6 behavior is preserved unless a caller
explicitly opts in. This makes the fix non-breaking and mergeable.

Add TestIssue342DefaultIsConcatenation to lock in the default behavior;
existing TestIssue342 now enables the flag.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@sonarqubecloud

sonarqubecloud Bot commented Jun 7, 2026

Copy link
Copy Markdown

@Richtermeister

Copy link
Copy Markdown
Contributor Author

@flosch I imagine there is some hesitancy around this feature since it would be another BC break to undo the prior one, so I added an option setting to make this behavior opt-in. What say you?

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.

1 participant