Maybe I missed it, but I think the encapsulation y...
# announcements
c
Maybe I missed it, but I think the encapsulation you want is
Copy code
class MyClass {
    private companion object {
        fun foo() {
            // This method is static and encapsulated to the degree that it cannot affect anything non-public on MyClass.
        }
    }

    fun bar() {
        foo()
    }
}