I’ve got a java class A that has a static class as a member:
class A { ... static class B {...} } I see code in java that just do A.B to access class B. However, I cannot do the same thing in my kotlin class:
import org.mypackage.A class C { ... fun doSomething(o: Any) { if (o is A.B) { ...} ... } } (intellij marks B as red when I do A.B.
My use case: I have an object that I want to cast to B, like o is A.B.
I did mvn clean compile and got this error: Cannot access 'B': it is public/*package*/ in 'A'.
My question: how do I access B in my kotlin class?
publicand try again