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] Interpolated String Improvements #51499

Open
59 of 65 tasks
333fred opened this issue Feb 25, 2021 · 2 comments
Open
59 of 65 tasks

[Test Plan] Interpolated String Improvements #51499

333fred opened this issue Feb 25, 2021 · 2 comments
Assignees
Labels
Area-Compilers Dev17 IDE Priority Feature - Interpolated String Improvements Interpolated string improvements Test Test failures in roslyn-CI User Story A single user-facing feature. Can be grouped under an epic.
Milestone

Comments

@333fred
Copy link
Member

333fred commented Feb 25, 2021

Proposal: ​
dotnet/csharplang#4487

Spec:
https://github.com/dotnet/csharplang/blob/main/proposals/csharp-10.0/improved-interpolated-strings.md

Feature Branch:
https://github.com/dotnet/roslyn/tree/features/interpolated-string

Compiler:

  • LangVersion
  • DefaultInterpolatedStringHandler
    • Not present
    • Present
    • Malformed
    • In an async method with no await holes
    • In an async method with await holes
  • Binary operator combination of interpolated strings
    • + operator
    • + operator with non interp string
  • Custom InterpolatedStringHandler
    • Incorrect ctor
      • implicit conversions to int?
  • Missing AppendLiteral
  • Incorect AppendLiteral
    • Not return bool or void
  • Missing AppendFormatted
  • Incorrect AppendFormatted
    • Not return bool or void
  • Mismatched AppendFormatted and AppendLiteral return types
  • Handler overloads
    • Pick handler over regular string for non-const
    • Regular string over handler for const
    • Handler over conversion to string
    • Handler overloads with arguments:
      • val over in
      • val over ref
  • Handler args as:
    • val
    • ref
    • in
    • implicit ref (allow mismatch)
    • out
    • normal / expanded form
    • other params after handler param
    • default values
    • reordered at call site
  • InterpolatedStringHandlerArgumentAttribute
    • Missing
    • Malformed
  • Parameter names
    • Single parameter name
    • Multiple parameters
    • ""
      • Passes this
      • On a static method
      • On a ctor
    • Incorrect parameter name
    • Mix of correct and incorrect param names
    • Referring to self
  • Nullable analysis for format holes and handler constructor (issue Proper nullable support for interpolated string handler constructors and conversions #54583)
  • Await in interpolation hole
    • Ref parameter
  • Dynamic handler
  • IOperation
  • Control Flow Graph
  • Semantic model
    • GetConstantValue on additive expressions

Productivity:

  • Intellisense for methods that have builder arguments
  • Verify experience on some methods/overloads that will get builders (string.Create, Debug.Assert, Debug.Write{Line}If, StringBuilder.Append{Line}, MemoryExtensions.TryWrite)
  • Extract interpolated string to a local (risks changing meaning/perf)
  • Find all refs on custom handler type and constructor, and append methods
  • go to definition

LDM:

  • conversion operator to string? (details) (answer: no)
  • parentheses and additive expressions (details) (answer: allow parens and suppressions)
@333fred 333fred added this to the C# 10 milestone Feb 25, 2021
@dotnet-issue-labeler dotnet-issue-labeler bot added the untriaged Issues and PRs which have not yet been triaged by a lead label Feb 25, 2021
@333fred 333fred removed the untriaged Issues and PRs which have not yet been triaged by a lead label Feb 25, 2021
@333fred
Copy link
Member Author

333fred commented Jul 1, 2021

Test ideas from review:

  • Test with InterpolatedStringHandlerArgumentAttribute on an out parameter.
  • Test arguments on delegates, lambdas, and local functions.
  • Test with handler having a default argument.
  • Test on dictionary initializers.
  • Test on extension methods
  • Test when an explicit conversion to a handler would fail, but would succeed in an argument position.

@333fred
Copy link
Member Author

333fred commented Jul 8, 2021

333fred added a commit that referenced this issue Sep 22, 2021
@jcouv jcouv modified the milestones: 17.0, 17.1 Sep 23, 2021
@jmarolf jmarolf added the User Story A single user-facing feature. Can be grouped under an epic. label Dec 2, 2021
@jcouv jcouv modified the milestones: 17.1, 17.2 Mar 17, 2022
@jcouv jcouv modified the milestones: 17.2, 17.3 May 14, 2022
@arunchndr arunchndr modified the milestones: 17.3, Backlog Sep 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Compilers Dev17 IDE Priority Feature - Interpolated String Improvements Interpolated string improvements Test Test failures in roslyn-CI User Story A single user-facing feature. Can be grouped under an epic.
Projects
None yet
Development

No branches or pull requests

8 participants