Skip to content

Warn when function type passed to interpolated string#19289

Draft
T-Gro wants to merge 1 commit intomainfrom
bugfix-warning-wrong-interpolation
Draft

Warn when function type passed to interpolated string#19289
T-Gro wants to merge 1 commit intomainfrom
bugfix-warning-wrong-interpolation

Conversation

@T-Gro
Copy link
Member

@T-Gro T-Gro commented Feb 13, 2026

No description provided.

- Extract duplicated warning block into warnForFunctionValuesInFillExprs local function
- Restore accidentally deleted withStdOutContains assertion in FormattableString test
@github-actions
Copy link
Contributor

❗ Release notes required

@T-Gro,

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:

* <Informative description>. ([PR #XXXXX](https://github.com/dotnet/fsharp/pull/XXXXX))

See examples in the files, listed in the table below or in th full documentation at https://fsharp.github.io/fsharp-compiler-docs/release-notes/About.html.

If you believe that release notes are not necessary for this PR, please add NO_RELEASE_NOTES label to the pull request.

You can open this PR in browser to add release notes: open in github.dev

Change path Release notes path Description
src/Compiler docs/release-notes/.FSharp.Compiler.Service/10.0.300.md No release notes found or release notes format is not correct
LanguageFeatures.fsi docs/release-notes/.Language/preview.md No release notes found or release notes format is not correct

if argTys.Length <> synFillExprs.Length then
error (Error(FSComp.SR.tcInterpolationMixedWithPercent(), m))

let warnForFunctionValuesInFillExprs () =
Copy link
Member

@vzarytovskii vzarytovskii Feb 14, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can be a upper level inline function and not create a closure over tcglobals and others, but take them as parameters. Will result in proper inlining.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Labels

None yet

Projects

Status: New

Development

Successfully merging this pull request may close these issues.

3 participants