-
Notifications
You must be signed in to change notification settings - Fork 6k
Document ToString() conversion for F# interpolated strings #49134
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Document ToString() conversion for F# interpolated strings #49134
Conversation
Co-authored-by: BillWagner <493969+BillWagner@users.noreply.github.com>
Co-authored-by: BillWagner <493969+BillWagner@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is ready for final review.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR addresses issue #45234 by clarifying the string conversion mechanism used in F# interpolated strings. The documentation previously explained typed interpolated strings but left users uncertain about how expressions are converted to strings in non-typed interpolated strings.
- Added explicit documentation for ToString() conversion in non-typed interpolated strings
- Clarified null handling behavior (converts to empty string)
- Distinguished between non-typed and typed interpolated string conversion rules
- Added required AI usage frontmatter per .NET documentation guidelines
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Summary
This PR addresses issue #45234 by clarifying how expression-to-string conversion works in F# interpolated strings.
Problem
The documentation for F# interpolated strings explained typed interpolated strings (with format specifiers like
%s{expr}
) but did not specify what conversion mechanism is used for non-typed interpolated strings (simple{expr}
syntax). Users were left uncertain about how their expressions would be converted to strings.Solution
Added a clarification in the Remarks section that explicitly documents:
ToString()
method to convert expressions to stringsnull
, an empty string is used insteadThis aligns with the F# compiler implementation as confirmed by @T-Gro's reference to the source code.
Example
Also added
ai-usage: ai-assisted
frontmatter per .NET documentation guidelines.Original prompt
Fixes #27048
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.
Internal previews