Open stephentoub opened 1 month ago
Tagging subscribers to this area: @dotnet/area-system-console See info in area-owners.md if you want to be subscribed.
Does it make sense to also create overloads which accept DefaultInterpolatedStringHandler
given that ReadOnlySpan<char> Text
property on it is internal
?
Why? There's already a string overload, so interpolation already works. You're concerned about performance with Console.WriteLine?
Haha no, not of WriteLine itself, but given there's an option to make it allocation-free, I thought it could be useful to raise it.
Please feel free to open a separate issue.
Background and motivation
Console.Write and Console.WriteLine have a bunch of overloads for writing out various data types, but none for
ReadOnlySpan<char>
. We should add some purely for convenience. You can achieve the same by.ToString()
'ing them or by usingConsole.Out.Write*
instead, but it's just a little bit of unnecessary friction.(I thought we already had an issue for this, but can't find it now.)
API Proposal
API Usage
Alternative Designs
n/a
Risks
n/a