@@ -49,27 +49,32 @@ where advanced options include:
4949 * warn (report a warning)
5050 -Xjvm-default={all|all-compatibility|disable|enable|compatibility}
5151 Emit JVM default methods for interface declarations with bodies.
52- -Xjvm-default=all-compatibility Generate both a default method in the interface, and a compatibility accessor
53- in the DefaultImpls class.
54- In case of inheritance from a Kotlin interface compiled in the old scheme
55- (DefaultImpls, no default methods), the compatibility accessor in DefaultImpls
56- will delegate to the DefaultImpls method of the superinterface. Otherwise the
57- compatibility accessor will invoke the default method on the interface, with
58- standard JVM runtime resolution semantics.
59- Note that if interface delegation is used, all interface methods are delegated.
60- The only exception are methods annotated with the deprecated @JvmDefault annotation.
61- -Xjvm-default=all Generate default methods for all interface declarations with bodies.
62- Do not generate DefaultImpls classes at all.
52+ -Xjvm-default=all Generate JVM default methods for all interface declarations with bodies in module.
53+ Do not generate DefaultImpls stubs for such declarations (that is default behaviour of compiler in 'disable' mode).
54+ If interface inherits such methods from interface compiled in 'disable' scheme
55+ then implicit DefaultImpls stubs would be generated as there are no default method for it.
6356 BREAKS BINARY COMPATIBILITY if some client code relies on the presence of
6457 DefaultImpls classes. Also prohibits the produced binaries to be read by Kotlin
6558 compilers earlier than 1.4.
6659 Note that if interface delegation is used, all interface methods are delegated.
6760 The only exception are methods annotated with the deprecated @JvmDefault annotation.
68- -Xjvm-default=disable Do not generate JVM default methods and prohibit @JvmDefault annotation usage.
69- -Xjvm-default=enable Allow usages of @JvmDefault; only generate the default method
61+ -Xjvm-default=all-compatibility In addition to `all` mode generate compatibility stubs in the DefaultImpls classes.
62+ Compatibility stubs could be useful for library and runtime authors
63+ to keep backward binary compatibility for existing client compiled against previous library versions.
64+ New 'all' and 'all-compatibility' modes are changing library ABI surface that will be used by client after their recompilation.
65+ In that sense client might be incompatible with previous library versions that REQUIRE PROPER LIBRARY VERSIONING.
66+ In case of inheritance from a Kotlin interface compiled in the old scheme
67+ (DefaultImpls, no default methods), the implicit stubs in DefaultImpls
68+ will delegate to the DefaultImpls method of the superinterface.
69+ Otherwise the compatibility stubs in DefaultImpls would invoke the default method on the interface via special accessor in it,
70+ with standard JVM runtime resolution semantics.
71+ Perform additional compatibility checks for classes in case of implicit specialized override
72+ presence in 'disable' scheme (See KT-39603 for more details)
73+ -Xjvm-default=disable Default behaviour. Do not generate JVM default methods and prohibit @JvmDefault annotation usage.
74+ -Xjvm-default=enable Deprecated. Allow usages of @JvmDefault; only generate the default method
7075 for annotated method in the interface
7176 (annotating an existing method can break binary compatibility)
72- -Xjvm-default=compatibility Allow usages of @JvmDefault; generate a compatibility accessor
77+ -Xjvm-default=compatibility Deprecated. Allow usages of @JvmDefault; generate a compatibility accessor
7378 in the 'DefaultImpls' class in addition to the default interface method
7479 -Xjvm-default-allow-non-default-inheritance
7580 Allow inheritance from 'all*' modes for 'disable' one
0 commit comments