Hello. Today I learned that `@JvmStatic` really ma...
# compiler
m
Hello. Today I learned that
@JvmStatic
really makes a method static inside an object declaration, if possible. So, I can imagine a corner case: 1. Module A contains an
interface A {}
2. Module B implements it:
Copy code
object B : A {
    @JvmStatic fun doSomething()
}
3. Module A adds a method in next version:
interface A { fun doSomething() }
Expected:
B.doSomething()
and
(B as A).doSomething()
is the same method. But I think AbstractMethodError will occur instead.
e
Why would both methods be the same? If you did not explicitly override the method from interface
A
then it should rightfully be a compile error
m
When you compile against A, there's no such method. After compilation, A is replaced by its new version.