-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Closed
Description
Champion issue: dotnet/csharplang#9058
Speclet: https://github.com/dotnet/csharplang/blob/main/proposals/csharp-14.0/partial-events-and-constructors.md
Feature branch: https://github.com/dotnet/roslyn/tree/features/PartialEventsCtors
- language version (
LangVersion)-
partial event - constructor:
partialtreated as type previously
-
-
partialmodifier location- after
event - after accessibility modifier
- on accessors
- after
- in non-partial
classorstruct(NotInPartialType) - in
interface(InInterface*) - missing implementation or declaration (
Missing*) - duplicate implementation or declaration (
Duplicate*) -
staticconstructor (StaticPartialConstructor_*) - constructor initializer:
this,base(ConstructorInitializers_) - primary constructor (
PrimaryConstructor_*)- with constructor initializer
-
extern(Extern_*) -
abstract(Abstract) - explicit interface implementation event (
ExplicitInterfaceImplementation) - partial event in interface:
- should not be
abstract - should be
virtualunless explicitlysealedPartial default interface members are not virtual #77346
- should not be
- event initializers (
EventInitializer_*)- multiple declarators and initializers
- missing accessors (
EventAccessorMissing) - Windows runtime event (
WinRtEvent) - attributes (
Attributes*)- combined from parts
- duplicate diagnostics
- event attribute targets
-
ObsoleteAttribute -
SkipLocalsInitAttribute(AttributeTests_WellKnownAttributes.SkipLocalsInit_*Event*) - caller-info attributes apply from definition only
- nullable attributes
- mismatched signatures (
Difference_*)- static and instance
- accessibility
- event type
- parameter type, ref kind, name,
scoped,params, default parameter value - tuple element names (
Difference_*Type) - nullability
- unsafe
-
virtual,override,sealed,new
- partial event is not field-like
- no backing field (
Metadata) - use
+=,-=, but not as a value (Use_EventAsValue)
- no backing field (
- defining declaration used for: (
Difference_ParameterNames)- lookup
- metadata emit
- doc comments (
DocumentationCommentCompilerTests.PartialEvent_*,PartialConstructor_*)- on one or both parts
- invalid comments
-
paramrefwhen parameter names differ
- public API: Public API for partial events #77203
-
IEventSymbol.*Partial* -
GetDeclaredSymbol
-
- breaking change (
ReturningPartialType_*)- documentation: see Compiler Breaking Changes - DotNet 10.md
- EE: evaluate partial constructor
- EnC: changes to partial implementation