<@U3T6LDWTD> That would break encapsulation, no? 4...
# language-proposals
@benleggiero That would break encapsulation, no? 4 replies Right, but at compile time, the compiler sees everything. Scope is just for the coder, and the compiler can break scope all it wants. In this example, the compiler would just treat the
field as
solely for the extension function, but still as
everywhere else. This should work out just fine, since the visibility from 3rd party code is unaffected. It's just exposing to the extension function the same capabilities a subclass would have, and extensions are (partially) a replacement for "utility" subclasses.