fix: add type specifiers to interpolated strings#4646
Merged
Conversation
Resolve all 127 GRA-INTERPOLATED-001 code-scanning alerts ("missing type
specifiers in interpolated strings") by adding the correct %-specifier to
every flagged interpolation hole. Output is unchanged; the specifiers add
compile-time type checking:
- %s for strings (names, full names, formatted types, paths, messages)
- %d for ints (generated identifiers, union tags, counters, arities)
- %O for objects whose default formatting already called ToString()
(DateTime timestamps, Fable.Type, obj values, string option)
The clean build is the verification: a wrong specifier is a compile error.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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
|
Collaborator
Author
|
This should be safe since a wrong specifier should trigger a compile error. But touches many files, so please have a look and approve the PR if it looks OK with you @MangelMaxime @ncave |
ncave
approved these changes
Jun 11, 2026
MangelMaxime
approved these changes
Jun 11, 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.
Summary
Resolves all 127
GRA-INTERPOLATED-001code-scanning alerts — "missing type specifiers in interpolated strings" — across 17 source files inFable.CompilerandFable.Transforms.Each flagged interpolation hole gets the correct
%-specifier so the type is checked at compile time. Output is unchanged; this only adds compile-time type safety:%sfor strings (names, full names, formatted types, paths, error/warning messages) — the majority%dfor ints (generated identifiers likearg{i},FSharpChoice${n}, union tags, counters, arities)%Ofor objects whose default formatting already calledToString()(DateTimetimestamps,Fable.Type,objvalues,string option)One site (
FSharp2Fable.Util.fs) had a multi-lineif/elseinside the hole that went offside once the prefix widened, so it was hoisted into a smallstaticSuffixbinding.Verification
dotnet build src/Fable.Cli/Fable.Cli.fsproj -c Releasesucceeds with 0 warnings, 0 errors. The build itself is the safety net: a wrong specifier (%son a non-string,%don a non-int) is a hard compile error, so a clean build confirms every choice is type-correct. The identifier-generating strings (which feed into generated code, not just messages) produce byte-identical output, so there is no behavior change.🤖 Generated with Claude Code