Skip to content
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

C#: Adding synthetic implicit ToString calls in binary- and string interpolation expressions. #18446

Draft
wants to merge 12 commits into
base: main
Choose a base branch
from

Conversation

michaelnebel
Copy link
Contributor

@michaelnebel michaelnebel commented Jan 8, 2025

In this PR we get the ball rolling on synthesizing compiler generated ToString calls.
We introduce ToString calls in binary expressions for concatenating strings and string interpolation expressions:
That is,

"abc" + x -> "abc" + x.ToString()`
$"abx{x}" -> $"abx{x.ToString()}"

@github-actions github-actions bot added the C# label Jan 8, 2025
@michaelnebel michaelnebel force-pushed the csharp/implicittostring2 branch 2 times, most recently from 7ba7af1 to 9959976 Compare January 9, 2025 10:43
@michaelnebel michaelnebel force-pushed the csharp/implicittostring2 branch 5 times, most recently from 04c455e to b586059 Compare January 10, 2025 08:57
@michaelnebel michaelnebel force-pushed the csharp/implicittostring2 branch from b586059 to bf46c42 Compare January 10, 2025 12:11
@michaelnebel michaelnebel force-pushed the csharp/implicittostring2 branch from bf46c42 to 825c64f Compare January 10, 2025 13:17
@michaelnebel michaelnebel changed the title C#: Adding synthetic implicit ToString calls in binary expressions. C#: Adding synthetic implicit ToString calls in binary- and string interpolation expressions. Jan 10, 2025
@michaelnebel michaelnebel force-pushed the csharp/implicittostring2 branch from 825c64f to 9ebee34 Compare January 10, 2025 13:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant