Today we encountered `Inheritance from an interfac...
# announcements
d
Today we encountered
Inheritance from an interface with ‘@JvmDefault’ members is only allowed with -Xjvm-default option
I tried Googling and searching in this Slack, but came up short. I understand why the interface compilation needs this flag. But why do the implementations need this flag too? Can't the compiler see that the interface is compiled on JVM target 8 and uses the
default
Java 8 in the method and simply compile as if you implemented in Java? Here's a concrete incarnation of this problem: https://ecosystem.atlassian.net/browse/JPERF-260
🤔 1
m
As @JvmDefault is experimental feature everything could be changed, so if your code inherits @JvmDefault it also could be broken with upcoming changes (I mean binary compatibility problems)
👍 1
d
uh oh, that's a surprise the experimental nature of
@JvmDefault
is not documented in the docs, or in the annotation KDoc or as an IntelliJ warning PS. despite the experimental status, do we know why the implementors need the compiler flag?
r
I think the compiler flag is the marker of its experimental status.
@JvmDefault
came in before the
@Experimental
annotation existed