Open gafter opened 7 years ago
This issue seems to be fixed in the spec / proposal: https://github.com/dotnet/csharplang/blob/main/proposals/utf8-string-literals.md#resolved-overload-resolution-breaks
This fix is just not implemented:
using System;
using static App;
M1("");
class App{
public static void M1(ReadOnlySpan<char> charArray) => Console.WriteLine(charArray.Length);
public static void M1(byte[] byteArray) => Console.WriteLine(byteArray.Length);
}
I got a problem when I update the SDK, it breaks my previous code
Error message:
Error CS8652: The feature 'Utf8 String Literals' is currently in Preview and unsupported. To use Preview features, use the 'preview' language version.
Failed CI:
Sample code: https://github.com/WeihanLi/SamplesInPractice/tree/63795cd961dc64ff3b92473a09eb90a59792db19/MiniAspNetCore
Will UTF-8 string literals support raw string literals?
var s2 = $"""
hello
"""u8; // Okay and type is ReadOnlySpan<byte>
@orthoxerox
Regular raw strings already work on SharpLab, verbatim strings too. But it doesn't appear that interpolated strings are supported, in any flavor.
Will interpolated UTF8 work with Interpolated String Handler ?
As HaloFour said, there are no interpolated UTF-8 strings.
@333fred Ok, @HaloFour edited his response after I wrote mine 😄
@FaustVX
Yeah, sorry, I missed the $
in the example code in the original question. 😄
Proposal: https://github.com/dotnet/csharplang/blob/main/proposals/csharp-11.0/utf8-string-literals.md Old draft proposal: https://github.com/dotnet/csharplang/issues/2911
Design Review
https://github.com/dotnet/csharplang/blob/main/meetings/2021/LDM-2021-10-27.md#utf-8-string-literals https://github.com/dotnet/csharplang/blob/main/meetings/2022/LDM-2022-01-26.md#open-questions-in-utf-8-string-literals https://github.com/dotnet/csharplang/blob/main/meetings/2022/LDM-2022-06-29.md#utf-8-literal-concatenation-operator