Utf8StringInterpolation
Utf8StringInterpolation copied to clipboard
Utf8StringWriter<T>.AppendLine shadows the eponymous extension method.
The Utf8StringWriter<T> type has:
- Instance method:
void AppendLine(string s) - Extension method:
void AppendLine(ref Utf8StringWriter<T>, [InterpolatedStringHandler] ref Utf8StringWriter<T>)
Due to C# overload resolution rules, calling writer.AppendLine($"...") always
resolves to the instance method, causing the interpolated string to be evaluated
via string.Format (allocations + boxing) instead of using the zero-allocation handler.
This defeats the primary purpose of the library and creates a silent performance trap.