Skip to content

Handle remaining interpolated-string forms adjacent to '=' (#16696)#19984

Open
edgarfgp wants to merge 3 commits into
dotnet:mainfrom
edgarfgp:fix-16696-remaining-variants
Open

Handle remaining interpolated-string forms adjacent to '=' (#16696)#19984
edgarfgp wants to merge 3 commits into
dotnet:mainfrom
edgarfgp:fix-16696-remaining-variants

Conversation

@edgarfgp

@edgarfgp edgarfgp commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

Follow-up to #19820, which fixed = adjacent to a $"..." interpolated string. That fix also covered =$"""...""" for free, but the verbatim and multi-dollar forms still lexed =$@, =@$, =$$ as the invalid operator =$.

This extends the same rule to those forms.

Before

let n = 42
let a =$@"{n}"          // error FS0035: '$' is not permitted ... in operator names
let b =@$"{n}"          // error FS0035
let c =$$"""{{n}}"""    // error FS0035

After

let n = 42
let a =$@"{n}"          // "42"
let b =@$"{n}"          // "42"
let c =$$"""{{n}}"""    // "42"  (multi-dollar strings use double braces for holes)

The lexer matches = plus the interpolated-string opener, consumes only the =, and rewinds so the regular interpolated-string lexer handles the rest. Operators containing $ are still rejected with FS0035, unchanged.

@github-actions

github-actions Bot commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

❗ Release notes required

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


✅ Found changes and release notes in following paths:

Change path Release notes path Description
src/Compiler docs/release-notes/.FSharp.Compiler.Service/11.0.100.md

)

Extend the merged '=$"' fix to the verbatim (=$@", =@$") and extended
multi-dollar (=$$""") interpolated-string forms, by matching '=' plus the
opener and rewinding so the regular interpolated-string lexer handles the rest.
Operators containing '$' remain rejected (FS0035), unchanged.
@edgarfgp edgarfgp force-pushed the fix-16696-remaining-variants branch from d43927a to 925d53a Compare June 23, 2026 13:50
@github-actions github-actions Bot added the AI-Tooling-Check-Scanned-Clean Tooling check: diff analyzed, no interesting infrastructure files label Jun 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AI-Tooling-Check-Scanned-Clean Tooling check: diff analyzed, no interesting infrastructure files

Projects

Status: New

Development

Successfully merging this pull request may close these issues.

1 participant