On Friday, 18 May 2018 at 16:24:24 UTC, Gheorghe Gabriel wrote:
On Friday, 18 May 2018 at 15:57:06 UTC, bachmeier wrote:
On Friday, 18 May 2018 at 15:40:52 UTC, KingJo

class A {
   private int x;
   private(this) int y;
}


I agree that this looks a bit strange.
My initial proposal was "sealed" instead "private(this)" today.

I'm really struggling to come up with any acceptable use case, whereby my class would want to have both private and sealed variables.( whether the word sealed is used, or private(this) is used, is irrelevant to this point though).

Can anyone come up with use case for this code below?

(It may well encourage even poorer software engineering, that private morhping into public).

-----
class A
{
   private int x; // ok, really public within the module.
   sealed int y; // now really private within the module.
}
----

Reply via email to