dotnet / dotnet/csharpstandard
15.2.7 [was 16.3.1] Add a note to clarify the "merging" aspect of partial classes?
- Dominant language
- C#
- Stars
- 815
- Forks
- 99
- Avg merge
- 1d 14h
- Merged PRs (30d)
- 16
Description
It's possible that someone reading 16.3.1 might expect the following code to work:
``` csharp
using System;
partial class Test {}
```
(Separate file)
``` csharp
partial class Test
{
static void Main()
{
Console.WriteLine("foo");
}
}
```
If the mental model is that the _source_ code is merged together, then that would be reasonable. I'm aware it doesn't actually work that way, but we should either note explicitly which aspects of partial classes are merged and which aren't, or we should make the wording clearer so that it just becomes obvious naturally.
(This is mentioned in 16.3.9 with an example, by the way...)
Contributor guide
Assessment
This issue has not been assessed yet.