Skip to content
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

Closed
48 of 53 tasks
AlekseyTs opened this issue Jan 13, 2022 · 4 comments
Closed
48 of 53 tasks

Test plan for Utf8StringLiterals feature. #58848

AlekseyTs opened this issue Jan 13, 2022 · 4 comments

Comments

@AlekseyTs
Copy link
Contributor

AlekseyTs commented Jan 13, 2022

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

  • LangVer
    • for u8 suffix
  • compiler test plan
  • parsing
    • u8 and U8 suffix allowed
    • no trivia between string constant and u8 suffix
    • single and multi-line verbatim strings
    • single and multi-line raw string literals
    • interpolated strings with suffix disallowed
    • disallowed in # directives
  • natural type of "abc"u8 is ReadOnlySpan<byte>: NaturalType_01
  • no target type of constant string with u8 suffix to byte[] or Span<byte>: ImplicitConversions_02
  • explicit conversion from constant string with u8 suffix to Span<byte>, or byte[] is disallowed: ExplicitConversions_02
  • implicit/explicit conversion from constant string to ReadOnlySpan<byte>, Span<byte>, or byte[] is disallowed: ImplicitConversions_01
  • implicit/explicit conversion from non-constant string to ReadOnlySpan<byte>, Span<byte>, or byte[] is disallowed: NoConversionFromNonConstant_01, _02
  • implicit/explicit conversion from null to ReadOnlySpan<byte>, Span<byte>, or byte[] is allowed (unchanged): NoBehaviorChangeForConversionFromNullLiteral_01
  • implicit/explicit conversion from (object)null to ReadOnlySpan<byte>, Span<byte>, or byte[] is disallowed: ImplicitConversions_04, ExplicitConversions_04
  • implicit/explicit conversion from (string)null to ReadOnlySpan<byte>, Span<byte>, or byte[] is disallowed: ImplicitConversions_03, ExplicitConversions_03
  • error reported for invalid UTF8 in u8 string: InvalidContent_02, _03
  • pattern matching ReadOnlySpan<byte> against string constants: PatternMatching_01, _02, _03
  • Expression tree use or implicit conversion and u8 literal disallowed
  • UTF8 byte[] stored in <PrivateImplementationDetails> if Length > 2
  • pattern matching ReadOnlySpan<byte> against string constants: PatternMatching_01, _02, _03
  • Expression tree use or implicit conversion and u8 literal disallowed
  • UTF8 byte[] stored in <PrivateImplementationDetails> if Length > 2
  • concatenation: UserDefinedConcatenation_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.
  • nullability of "abc"u8: NullableAnalysis_03
  • Missing and invalid type and members: ReadOnlySpan<T>, Span<T>, etc.
  • Document breaking changes (none)
  • IOperation: IOperationTests_IUtf8StringOperation
  • GetTypeInfo()
  • GetConversion()
  • EE
  • EnC with <PrivateImplementationDetails>
  • SyntaxNormalizer: string, single and multi-line raw string
  • null terminator: NullTerminate_01, _02

Public API

IDE

  • SyntaxClassifier: string, single and multi-line raw string
  • QuickInfo: byte[] natural type

Debugger

  • Can/should we show the string (rather than just bytes) when hovering over such variables? (There's discussion on csharplang on this and decompilation experience)

Other

@dotnet-issue-labeler dotnet-issue-labeler bot added the untriaged Issues and PRs which have not yet been triaged by a lead label Jan 13, 2022
@jcouv jcouv removed the untriaged Issues and PRs which have not yet been triaged by a lead label Feb 11, 2022
@jcouv jcouv added this to the 17.2 milestone Feb 11, 2022
@jcouv jcouv modified the milestones: 17.2, 17.3 Mar 17, 2022
@jaredpar jaredpar modified the milestones: 17.3, 17.4 Jun 24, 2022
@ericwj
Copy link

ericwj commented Aug 30, 2022

Re

  • interpolated strings with suffix disallowed

Moved.

@AlekseyTs
Copy link
Contributor Author

@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.

@CyrusNajmabadi
Copy link
Member

CyrusNajmabadi commented Aug 30, 2022

@ericwj not sure what you mean:

image

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!

@cston
Copy link
Member

cston commented Oct 19, 2022

Closing as completed.

@cston cston closed this as completed Oct 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants