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

String interpolation errors when concatenating multiple string #55993

Closed
ceccomil opened this issue Aug 26, 2021 · 6 comments
Closed

String interpolation errors when concatenating multiple string #55993

ceccomil opened this issue Aug 26, 2021 · 6 comments
Labels
Area-Compilers Feature - Interpolated String Improvements Interpolated string improvements Resolution-Duplicate The described behavior is tracked in another issue

Comments

@ceccomil
Copy link

Using Preview 7, It was working on Preview 6, I got this weird behaviour.

Considering this simple console app:

using System;

//NET6.0 Preview 7

var myValue1 = "|someValue|";
var myResult = $"I want the value here: {myValue1}"; //this is fine 
Console.WriteLine(myResult);
Console.WriteLine();


myResult = $"I want the value here: {myValue1};" +
    $"Another String using {myValue1} in the middle";
Console.WriteLine(myResult);
Console.WriteLine();

This is the result I'm getting (see also picture below):

I want the value here: |someValue|

;|someValue|I want the value here:  in the middle|someValue|Another String using

image

@KalleOlaviNiemitalo
Copy link

May be a duplicate of #55461.

@marcpopMSFT marcpopMSFT transferred this issue from dotnet/sdk Aug 27, 2021
@ghost
Copy link

ghost commented Aug 27, 2021

Tagging subscribers to this area: @dotnet/area-system-console
See info in area-owners.md if you want to be subscribed.

Issue Details

Using Preview 7, It was working on Preview 6, I got this weird behaviour.

Considering this simple console app:

using System;

//NET6.0 Preview 7

var myValue1 = "|someValue|";
var myResult = $"I want the value here: {myValue1}"; //this is fine 
Console.WriteLine(myResult);
Console.WriteLine();


myResult = $"I want the value here: {myValue1};" +
    $"Another String using {myValue1} in the middle";
Console.WriteLine(myResult);
Console.WriteLine();

This is the result I'm getting (see also picture below):

I want the value here: |someValue|

;|someValue|I want the value here:  in the middle|someValue|Another String using

image

Author: ceccomil
Assignees: -
Labels:

area-System.Console, untriaged

Milestone: -

@adamsitnik adamsitnik transferred this issue from dotnet/runtime Aug 28, 2021
@dotnet-issue-labeler dotnet-issue-labeler bot added the untriaged Issues and PRs which have not yet been triaged by a lead label Aug 28, 2021
@dotnet-issue-labeler
Copy link

I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label.

@adamsitnik
Copy link
Member

It might have been fixed by #55494 in 17.0p4, but I am not 100% sure so I would prefer someone from the Roslyn Team to confirm

@stephentoub
Copy link
Member

Yes, this is a dup of #55461.

@jaredpar jaredpar added Area-Compilers Feature - Interpolated String Improvements Interpolated string improvements Resolution-Duplicate The described behavior is tracked in another issue and removed untriaged Issues and PRs which have not yet been triaged by a lead labels Aug 30, 2021
@jcouv
Copy link
Member

jcouv commented Sep 3, 2021

Closing as duplicate of #55461. Thanks for reporting

@jcouv jcouv closed this as completed Sep 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Compilers Feature - Interpolated String Improvements Interpolated string improvements Resolution-Duplicate The described behavior is tracked in another issue
Projects
None yet
Development

No branches or pull requests

6 participants