dotnet / docs

This repository contains .NET Documentation.
https://learn.microsoft.com/dotnet
Creative Commons Attribution 4.0 International
4.22k stars 5.87k forks source link

Implementing partial members is not optional #42442

Open bravequickcleverfibreyarn opened 2 weeks ago

bravequickcleverfibreyarn commented 2 weeks ago

Type of issue

Typo

Description

From https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/partial-member

Partial members enable class designers to provide member hooks, similar to event handlers, that developers can decide to implement or not.

I believe that this second comma after handlers is mistake. By its means phrase is read as if developer can opt-in to implementing partial members which is not possible.

Otherwise error CS9248 Partial property '' must have an implementation is inevitable.

cs9428

Page URL

https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/partial-member

Content source URL

https://github.com/dotnet/docs/blob/main/docs/csharp/language-reference/keywords/partial-member.md

Document Version Independent Id

85bf7eb0-b476-94b6-e10a-d0f42fee407b

Article author

@BillWagner

Metadata

bravequickcleverfibreyarn commented 2 weeks ago

Maybe I little got it. There is phrase

Partial types and members provide a way for human developers to write part of a type while tools write other parts of the type.

That would imply, regardless issued error, during building code generation would fix it. So after build no errors presented.

On other hand this is in contrary to

If the developer doesn't supply an optional implementing declaration, the compiler can remove the declaring declaration at compile time.

Usually error message indicates unbuildable solution and at least with my set:

these are not ignored by build which fails in turn.

Failed Build

So these statements creates impossible contrast, FMPOV.