Overload resolution for FormattableString (bug?) #675
Answered
by
yaakov-h
rikimaru0345
asked this question in
Q&A
-
Hello, I have three small questions.
public static string L(FormattableString fs)
=> string.Format(fs.Format, fs.GetArguments());
public static string L(string s)
=> s;
public static string L(this FormattableString fs)
{
return string.Format(fs.Format, fs.GetArguments());
} Is the second one really supposed to not work, calling L(...) directly will work though.
I hope someone can explain if this is just an unintended side-effect, or if there's any actual reasoning behind this behaviour. |
Beta Was this translation helpful? Give feedback.
Answered by
yaakov-h
Jun 12, 2017
Replies: 2 comments
Answer selected by
YairHalberstadt
-
I read the threads you linked. 99% of the users could live without being able to sub-class FormattableString (they can write a library or something), but bad performance can't be fixed. Really sad. Bad decisions. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
dotnet/roslyn#173
dotnet/roslyn#518
dotnet/roslyn#8097