On Friday, 18 May 2018 at 12:00:58 UTC, Gheorghe Gabriel wrote:

I think this code has cleaner sintax:

class A {
    private int x;
    sealed int y;
}
void main() {
    A a = new A();
    a.x = 7; // ok, it's private to module
    a.y = 3; // error, it's sealed to class
}

I agree. I actually like your solution much better, and, it's less likely to cause confusion with use of the word 'sealed', because it's applied to the variable (and therefore people from other languages won't get confused having sealed applied at the class level - unless there are languages that applye sealed at the variable level).

Now, you write that DIP (that everyone will ignore).

Reply via email to