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 "extended partial methods" #43795

Closed
42 of 43 tasks
RikkiGibson opened this issue Apr 29, 2020 · 3 comments
Closed
42 of 43 tasks

Test plan for "extended partial methods" #43795

RikkiGibson opened this issue Apr 29, 2020 · 3 comments
Assignees
Labels
Area-Compilers Test Test failures in roslyn-CI
Milestone

Comments

@RikkiGibson
Copy link
Contributor

RikkiGibson commented Apr 29, 2020

Championed issue: dotnet/csharplang#3301
Draft spec: dotnet/csharplang#3417

  • accessibility modifiers
    • LangVersion checks
    • require implementation part
    • require equivalent accessibility between signature and implementation parts
  • 'out' params
    • require accessibility modifiers
  • non-'void' returns
    • require accessibility modifiers
  • 'virtual', 'override', 'sealed', 'new' modifiers
    • require accessibility modifiers
    • require equivalent sets of modifiers on both parts
  • 'extern' modifier
    • require accessibility modifiers
    • only implementation part can specify it
    • when implementation is 'extern' the definition part has IsExtern == true
    • [DllImport] can go on either part
  • 'async' modifier
    • require accessibility modifiers (async partial void methods are already allowed)
    • only implementation part can specify it
    • when implementation is 'async' the definition part has 'IsAsync == true' (?)
      • preserving existing behavior that 'IsAsync == false' on definition.
  • nullability attributes
    • When overriding a partial method with nullability attributes, the compiler needs to recognize+require providing the same nullability attributes present on both parts unioned.
    • when overriding a partial DIM
  • partial methods that implement interface methods
  • entry point with non-'void' return
    • with definition and implementation
    • with only a definition
  • call to partial method with 'out' parameter definitely assigns the argument
  • ref returns
  • calls from outside the containing type
    • from a different type
    • from a different compilation
  • Override a method when the base is a constructed type Extended partial methods #43582 (comment)
  • different containing type kinds
  • SkipLocalsInitAttribute on definition or implementation
  • EnumeratorCancellationAttribute on definition or implementation
  • include modopt from overridden method https://github.com/333fred/roslyn/blob/test/src/Compilers/CSharp/Test/Emit/CodeGen/CodeGenFunctionPointersTests.cs#L5269-L5310
  • overridden method has an explicit array size https://github.com/333fred/roslyn/blob/test/src/Compilers/CSharp/Test/Emit/CodeGen/CodeGenFunctionPointersTests.cs#L6215-L6481
  • 'in' thunk (explicit implementation of interface method due to 'in' param)
  • 'virtual partial' in interface
  • consume extended partial in VB
  • XML docs

IDE side:

  • go to implementation (it's not clear what is meant by this--F12 on partial methods in general will go to the implementation part if it exists, and go to implementation will go to the interface part. Since this is a pre-existing behavior for partial methods in the IDE I don't think any work related this belongs in this test plan.)
  • completion for partials Signature completion for extended partial methods #46752

Chunks of the work:

  • Most diagnostic checks in Unexpected warning CS0649: Field '(T1, T2).F1' is never assigned to #43588

    • accessibility mods
    • 'out' params
    • extended modifiers (excluding 'async')
  • IsExtern/IsAsync behavior

  • Pending decision: we should consider allowing or even requiring repetition of nullability attributes across the definition and implementation parts of the method.

    • (rigibson note) I'm dropping this idea after some consideration. 😄 Can revise the behavior later since it is nullable related.
@ufcpp

This comment has been minimized.

@RikkiGibson
Copy link
Contributor Author

Closing out since the last remaining item has been spun off into its own issue. /cc @jaredpar

@RikkiGibson
Copy link
Contributor Author

We'd like to add IDE feature buddies as assignees to the feature test plan. Since I am lead to believe you are the buddy for this feature I'm going to add you as an assignee even though the issue is closed @CyrusNajmabadi. /cc @jinujoseph

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Compilers Test Test failures in roslyn-CI
Projects
None yet
Development

No branches or pull requests

4 participants