3 ms·
I think the post is making this seem more complicated than it is. (Not a criticism of the post -- it's interesting to explore edge cases sometimes.) The genera
by jmull 6y ago
I think the post is making this seem more complicated than it is. (Not a criticism of the post -- it's interesting to explore edge cases sometimes.)
The general takeaway is private fields are private, and the "in" operator is consistent with that.
If constructor code results in an incorrectly constructed object, that's simply a bug in the constructor code, not really anything specifically to do with fields, private fields, in operator, etc. (I guess this is a criticism of the post. Bringing this up implies it's somehow relevant to the topic, but it isn't and causes confusion.)