-
Notifications
You must be signed in to change notification settings - Fork 4.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Test plan for Utf8StringLiterals feature. #58848
Comments
Re
Moved. |
@ericwj This issue is not for general purpose discussions on topics related to the feature. If you have an issue to report/discuss, please open a separate dedicated issue for that. |
@ericwj not sure what you mean: The curlies are not interpolation holes here. -- Just saw Aleksey's comment. If you want to discuss this further, please open a separate issue/discussion thread. Thanks! |
Closing as completed. |
Speclet - https://github.com/dotnet/csharplang/blob/main/proposals/csharp-11.0/utf8-string-literals.md
Feature branch - https://github.com/dotnet/roslyn/tree/features/Utf8StringLiterals
Championed issue - dotnet/csharplang#184
Compiler
u8
suffixu8
andU8
suffix allowedu8
suffix#
directives"abc"u8
isReadOnlySpan<byte>
:NaturalType_01
u8
suffix tobyte[]
orSpan<byte>
:ImplicitConversions_02
u8
suffix toSpan<byte>
, orbyte[]
is disallowed:ExplicitConversions_02
ReadOnlySpan<byte>
,Span<byte>
, orbyte[]
is disallowed:ImplicitConversions_01
ReadOnlySpan<byte>
,Span<byte>
, orbyte[]
is disallowed:NoConversionFromNonConstant_01
,_02
null
toReadOnlySpan<byte>
,Span<byte>
, orbyte[]
is allowed (unchanged):NoBehaviorChangeForConversionFromNullLiteral_01
(object)null
toReadOnlySpan<byte>
,Span<byte>
, orbyte[]
is disallowed:ImplicitConversions_04
,ExplicitConversions_04
(string)null
toReadOnlySpan<byte>
,Span<byte>
, orbyte[]
is disallowed:ImplicitConversions_03
,ExplicitConversions_03
u8
string:InvalidContent_02
,_03
ReadOnlySpan<byte>
against string constants:PatternMatching_01
,_02
,_03
u8
literal disallowedbyte[]
stored in<PrivateImplementationDetails>
if Length > 2ReadOnlySpan<byte>
against string constants:PatternMatching_01
,_02
,_03
u8
literal disallowedbyte[]
stored in<PrivateImplementationDetails>
if Length > 2UserDefinedConcatenation_01
, etc.const ReadOnlySpan<byte> x = "abc"u8;
is disallowed:NotConstant_01
void M(Span<byte> x = "abc"u8)
is disallowed:DefaultParameterValues_01
,_02
"abc"u8
and implicit conversion disallowed in attribute value:AttributeArgument_01
, etc."abc"u8
:NullableAnalysis_03
ReadOnlySpan<T>
,Span<T>
, etc.Document breaking changes(none)IOperationTests_IUtf8StringOperation
GetTypeInfo()
GetConversion()
<PrivateImplementationDetails>
NullTerminate_01
,_02
Public API
IDE
byte[]
natural typeDebugger
Other
readonlySpanOfByte is "abc"
orreadonlySpanOfByte is "abc"u8
? (also reported here and here) [Proposal]: UTF-8 Literal Pattern Matching Support csharplang#6161u8
suffix: notesReadOnlySpan<byte>
: notesbyte[]
: notesThe text was updated successfully, but these errors were encountered: