feat(js/ts/python): add missing StringBuilder.Append overloads for numeric types#4568
Merged
dbrattli merged 2 commits intoApr 27, 2026
Conversation
Contributor
Python Type Checking Results (Pyright)
Excluded files with errors (4 files)These files have known type errors and are excluded from CI. Remove from
|
Member
|
/repo-assist Rebase this PR on the latest version of main branch |
Contributor
|
✓ Repo Assist completed successfully, see workflow run. |
Contributor
Author
|
Issue created: #4576
|
Contributor
Author
|
Note The pull request was not created — a fallback review issue was created instead due to protected file changes: #4576 🤖 Repo Assist here. I've rebased this PR on the latest
|
Add Append overloads for int8, byte, int16, uint16, uint32, int64, uint64, and float32 to match the full set available in .NET's StringBuilder. The Rust target already had all these overloads; this brings TypeScript and Python targets to parity. Closes #2636 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
fd2ab6e to
7d3128a
Compare
dbrattli
approved these changes
Apr 27, 2026
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.
🤖 This PR was created by Repo Assist, an automated AI assistant.
Summary
Adds missing
StringBuilder.Appendoverloads for numeric types to the TypeScript and Python targets, bringing them to parity with the Rust target (which already had all of these) and .NET'sStringBuilder.Overloads added:
int8,byte,int16,uint16,uint32,int64,uint64,float32Closes #2636
Root cause
The original implementation only included
Append(int),Append(float),Append(bool),Append(char), andAppend(string). Missing numeric type overloads caused compile errors or fell back toAppend(obj)with potential formatting differences.Changes
src/fable-library-ts/System.Text.fs— add 8 numeric overloadssrc/fable-library-py/fable_library/System.Text.fs— same additionstests/Js/Main/StringTests.fs— new test for numeric overloadstests/Python/TestString.fs— new test for numeric overloadsThe Dart and Beam targets share the same
System.Text.fs(Dart has its own, and both are equivalent in scope) — they can be updated in a follow-up if needed.Trade-offs
All new overloads delegate to
string<T>conversion, which is consistent with the existing pattern and matches .NET semantics.