Skip to content

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

Merged
abonie merged 7 commits into
dotnet:mainfrom
edgarfgp:fix-16696-remaining-variants
Jun 25, 2026
Merged

Handle remaining interpolated-string forms adjacent to '=' (#16696)#19984
abonie merged 7 commits into
dotnet:mainfrom
edgarfgp:fix-16696-remaining-variants

Conversation

@edgarfgp

@edgarfgpedgarfgp 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

letn=42leta=$@"{n}"// error FS0035: '$' is not permitted ... in operator namesletb=@$"{n}"// error FS0035letc=$$"""{{n}}"""// error FS0035

After

letn=42leta=$@"{n}"// "42"letb=@$"{n}"// "42"letc=$$"""{{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-actionsBot 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 pathRelease notes pathDescription
src/Compilerdocs/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
edgarfgpforce-pushed the fix-16696-remaining-variants branch from d43927a to 925d53aCompareJune 23, 2026 13:50
@github-actionsgithub-actionsBot added the AI-Tooling-Check-Scanned-Clean Tooling check: diff analyzed, no interesting infrastructure files label Jun 23, 2026
@github-actionsgithub-actionsBot added the ⚠️ Affects-Compiler-Output Tooling check: PR touches IL emission or codegen label Jun 23, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🔍 Tooling Safety Check — Affects-Compiler-Output
Affects-Compiler-Output: modifies src/Compiler/lex.fsl lexer rules

Generated by PR Tooling Safety Check · opus46 3.1M ·

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

Labels

⚠️ Affects-Compiler-OutputTooling check: PR touches IL emission or codegenAI-Tooling-Check-Scanned-CleanTooling check: diff analyzed, no interesting infrastructure files

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

2 participants

@edgarfgp@abonie