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 "async method builder override" #51999

Closed
19 tasks done
jcouv opened this issue Mar 19, 2021 · 1 comment
Closed
19 tasks done

Test plan for "async method builder override" #51999

jcouv opened this issue Mar 19, 2021 · 1 comment

Comments

@jcouv
Copy link
Member

jcouv commented Mar 19, 2021

Proposal: dotnet/csharplang#1407
Spec: https://github.com/dotnet/csharplang/blob/main/proposals/csharp-10.0/async-method-builders.md

  • Usage with type parameter: [MyBuilderOverride<int>] (currently disallowed) (clarifying message in PR Use specific error message for wrong arity in async builder #54632)
  • Update attribute type in BCL (issue API Proposal: AsyncMethodBuilderOverrideAttribute and PoolingAsyncValueTaskMethodBuilders runtime#49903, PR Add AsyncMethodBuilderOverride and PoolingAsyncValueTaskMethodBuilders runtime#50116)
  • LDM confirm we need a fully functional task-like return type (answer: unused so unvalidated, but lambdas must have explicit return types)
  • LDM confirm we keep the same validation rule on builder type (answer: no accessibility requirement)
  • LDM confirm we keep the same validation rules on well-known members (answer: all must be public)
  • LDM confirm that the builder factory vs. builder indirection only applies to overrides (answer: indirection is now out-of-scope)
  • LangVer 😉
  • No validation on builder of return type. The return type may not even be task-like.
    • We also test with Task/ValueTask return types (that’s one of the primary scenarios)
    • Nullability analysis of return statement
  • Binding rules for return statement:
    • return with no value and implicit return allowed if method-level builder is non-generic
    • return with value involves conversion to the type argument
  • Attribute can be used on method, lambda with explicit type, and local function
  • The type used as method-level builder must be a non-void non-error named type.
    • We validate the builder the same way that we do for task-like types, except that we don’t care about the method-level builder’s accessibility.
  • We validate numerous kinds of bad builders: missing members, incorrect signatures or return types, static, ref return, non-public accessibility, …
  • Specifying the attribute more than once (first one is used)
  • No IDE impact

Task-like types spec: https://github.com/dotnet/csharplang/blob/main/proposals/csharp-7.0/task-types.md

@jcouv jcouv added this to the C# 10 milestone Mar 19, 2021
@jcouv jcouv self-assigned this Mar 19, 2021
@dotnet-issue-labeler dotnet-issue-labeler bot added the untriaged Issues and PRs which have not yet been triaged by a lead label Mar 19, 2021
@jaredpar jaredpar added Feature Request and removed untriaged Issues and PRs which have not yet been triaged by a lead labels Mar 22, 2021
@jcouv jcouv added this to Active/Investigating in Compiler: Julien's umbrellas Jun 9, 2021
@jcouv
Copy link
Member Author

jcouv commented Jun 24, 2021

Feature was merged for dev17.0p2

@jcouv jcouv closed this as completed Jun 24, 2021
@jcouv jcouv reopened this Jun 29, 2021
@jcouv jcouv closed this as completed Jul 6, 2021
@jcouv jcouv moved this from Active/Investigating to Requires IDE or project-system work in Compiler: Julien's umbrellas Jul 6, 2021
@jcouv jcouv moved this from Requires IDE or project-system work to Done Umbrellas in Compiler: Julien's umbrellas Jul 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done Umbrellas
Development

No branches or pull requests

2 participants