Skip to content

Draft spec for extended partial methods #3417

@RikkiGibson

Description

@RikkiGibson

Related to #3301
Proposal: https://github.com/dotnet/csharplang/blob/master/proposals/csharp-9.0/extending-partial-methods.md

C# 9 introduces a new kind of partial method called an extended partial method. An extended partial method must have both a defining declaration and an implementing declaration.

They are required to have explicit accessibility modifiers, which must be identical on both declarations. They are permitted to have out parameters and to have non-void return types. They are permitted to use the virtual, override, sealed, and new modifiers. Both declarations must contain identical combinations of these modifiers, although they may be present in a different order in each declaration.

A single declaration of an extended partial method is said to be an implementing partial declaration if it has a body or if it has an extern modifier. Only the implementing declaration is permitted to have an extern modifier.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions