-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Closed
Description
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 voidmethods 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.
Reactions are currently unavailable