Cleanup: use print/printn for simple string literals and drop redundant sprintf - #20544
charlesroddie wants to merge 2 commits into
Conversation
Replace printfn/printf "literal" with printn/print where FSharp.Core 11 is available, remove sprintf around literals with no format specifiers, and fix doc examples missing the $ on interpolated strings. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
❗ Release notes requiredYou can open this PR in browser to add release notes: open in github.dev Caution No release notes found for the changed paths (see table below). Please make sure to add an entry with an informative description of the change as well as link to this pull request, issue and language suggestion if applicable. Release notes for this repository are based on Keep A Changelog format. The following format is recommended for this repository: `* . (PR #XXXXX)`
If you believe that release notes are not necessary for this PR, please add NO_RELEASE_NOTES label to the pull request.
|
|
🔍 Tooling Safety Check — Affects-Agent-Config, Affects-Bootstrap, Affects-Build-Infra, Affects-Compiler-Output, Affects-Design-Time, Affects-Test-Tooling
|
Follow-up to #20542, for format strings with no holes.
printfn "..."→printn "..."andprintf "..."→print "..."where the referenced FSharp.Core has themsprintf "..."→"..."(no FSharp.Core dependency, so compiler code is included)Array/List/Seqiteridoc examples that usedprintfn "{i}: {v}"without$Changed
async,fslib-extra-pervasives,array,list,seq)coroutines.fsxTheBigFileOfDebugStepping.fsx,docs/debug-emit.mdcodingConventions.fsx,identifierAnalysisByType.fsx,ExtractTimingsFromBinlog.fsx,pick-insert-line.fsxRemoveUnnecessaryParenthesesTests(continuation lines re-indented where offside alignment depended on name length)sprintfremoved inTypedTree.fsToStringoverrides,TestLib.Utils.fs,attributes/test.fsx,topinit/generate.fsxNot changed
FSharp.Compiler.Service.slnxproject code usingprintfn/printf: builds against the shipped FSharp.Core 10.0.101, which lacksprint/printn.sprintf "Hello" = "Hello"inlibtest(prevents constant folding) andEditorTests.fsformat-string range tests.Tutorial.fsxproject template: users may build against an older FSharp.Core.🤖 Generated with Claude Code