Replies: 3 comments 32 replies
-
Here's a case I can think of for public partial class MyCollection<T> : IEnumerable<T>
{
public Enumerator GetEnumerator() => new(this);
public struct Enumerator : IEnumerator<T>
{
// other files in this project shouldn't access this ctor,
// but it needs to be internal at least for the outer type to use
file internal Enumerator(MyCollection<T> collection) //......
}
} |
Beta Was this translation helpful? Give feedback.
-
Ability to combine file accessibility with others could encourage a new level of "abstraction": per file, which to be honest I don't really see as a good thing. Is this really expected to be used outside SGs? If not I'd suggest |
Beta Was this translation helpful? Give feedback.
-
For structs, I will re-iterate - please, please try to make structs work like classes - taking into account breaking existing code, like it was noted, using fix suggestions, etc. I understand why C# 1 went with parameterless struct ctors being always available, but it felt weird back then, and today, with |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
https://github.com/dotnet/csharplang/blob/main/meetings/2022/LDM-2022-03-30.md
Agenda
: this()
file private
accessibilityBeta Was this translation helpful? Give feedback.
All reactions