JvmDefaultWithoutCompatibility

JVM
1.4
@Target([AnnotationTarget.CLASS]) annotation class JvmDefaultWithoutCompatibility
(source)

Prevents the compiler from generating compatibility accessors for the annotated class or interface, and suppresses any related compatibility warnings. In other words, this annotation makes the compiler generate the annotated class or interface in the -Xjvm-default=all mode, where only JVM default methods are generated, without DefaultImpls.

Annotating an existing class with this annotation is a binary incompatible change. Therefore this annotation makes the most sense for new classes in libraries which opted into the compatibility mode.

Used only with -Xjvm-default=all-compatibility.

Constructors

JVM
1.0

<init>

Prevents the compiler from generating compatibility accessors for the annotated class or interface, and suppresses any related compatibility warnings. In other words, this annotation makes the compiler generate the annotated class or interface in the -Xjvm-default=all mode, where only JVM default methods are generated, without DefaultImpls.

JvmDefaultWithoutCompatibility()

Extension Properties

JVM
1.0

annotationClass

Returns a KClass instance corresponding to the annotation type of this annotation.

val <T : Annotation> T.annotationClass: KClass<out T>