bloder
02/10/2018, 12:02 AMclass C {
companion object {
@JvmStatic fun staticMethod() {}
fun instanceMethod() {}
}
}
You have this class with a companion object and in this object has two methods, one annotated with @JvmStatic. With jvmstatic annotation the compiler will generate both a static method in the enclosing class of the object and an instance method in the object itself:
C.foo(); // works fine
C.bar(); // error: not a static method
C.Companion.foo(); // instance method remains
C.Companion.bar(); // the only way it works