Quantcast
Channel: YouTrackReSharper (RSRP) - Bug and Issue Tracker
Viewing all articles
Browse latest Browse all 106942

RSRP-467854: "Move to resource" created invalid value in case of interpolated string

$
0
0
Reporter Alexander Kurakin (Alexander.Kurakin) Alexander Kurakin (Alexander.Kurakin)
Created Jan 9, 2018 6:47:09 PM
Updated Apr 11, 2018 6:49:00 PM
Resolved Apr 11, 2018 6:49:00 PM
Subsystem Localization (i18n, ResX)
Assignee Andrey Dyatlov (Andrey.Dyatlov)
Priority Major
State Fixed
Type Bug
Fix version 2017.3
Affected versions Backlog
Fixed In Version ReSharper Undefined
VsVersion All Versions
I have string with place holder for TimeSpan:
Console.WriteLine($"Synchronization in progress. Passed time {TimeSpan.FromMinutes(10):hh\\:mm\\:ss}."); 

"Move to resource" created value:
Synchronization in progress. Passed time {0:hh\\:mm\\:ss}. 

Format value is not valid. I have exception in runtime:
System.FormatException 
HResult=0x80131537
Message=Input string was not in a correct format.
Source=mscorlib
StackTrace:
at System.Globalization.TimeSpanFormat.FormatCustomized(TimeSpan value, String format, DateTimeFormatInfo dtfi)
at System.Globalization.TimeSpanFormat.Format(TimeSpan value, String format, IFormatProvider formatProvider)
at System.TimeSpan.ToString(String format, IFormatProvider formatProvider)
at System.Text.StringBuilder.AppendFormatHelper(IFormatProvider provider, String format, ParamsArray args)
at System.String.FormatHelper(IFormatProvider provider, String format, ParamsArray args)
at System.IO.TextWriter.WriteLine(String format, Object arg0)
at System.IO.TextWriter.SyncTextWriter.WriteLine(String format, Object arg0)
at System.Console.WriteLine(String format, Object arg0)
at ConsoleApp.Program.Main() in C:\Users\ANest\Documents\Visual Studio 2017\Projects\LocTest\ConsoleApp\Program.cs:line 24

Problem in format value inside string interpolation.

R# "Move to resource" created valid value for string value without interpolation:
Console.WriteLine("Synchronization in progress. Passed time {0:hh\\:mm\\:ss}.", TimeSpan.FromMinutes(10)); 

Viewing all articles
Browse latest Browse all 106942

Trending Articles