Add new options for '-Xjvm-default'
This commit is contained in:
+26
-7
@@ -38,13 +38,32 @@ where advanced options include:
|
||||
* ignore
|
||||
* strict (experimental; treat as other supported nullability annotations)
|
||||
* warn (report a warning)
|
||||
-Xjvm-default={disable|enable|compatibility}
|
||||
Allow to use '@JvmDefault' annotation for JVM default method support.
|
||||
-Xjvm-default=disable Prohibit usages of @JvmDefault
|
||||
-Xjvm-default=enable Allow usages of @JvmDefault; only generate the default method
|
||||
in the interface (annotating an existing method can break binary compatibility)
|
||||
-Xjvm-default=compatibility Allow usages of @JvmDefault; generate a compatibility accessor
|
||||
in the 'DefaultImpls' class in addition to the interface method
|
||||
-Xjvm-default={all|all-compatibility|disable|enable|compatibility}
|
||||
Emit JVM default methods for interface declarations with bodies.
|
||||
-Xjvm-default=all-compatibility Generate both a default method in the interface, and a compatibility accessor
|
||||
in the DefaultImpls class.
|
||||
In case of inheritance from a Kotlin interface compiled in the old scheme
|
||||
(DefaultImpls, no default methods), the compatibility accessor in DefaultImpls
|
||||
will delegate to the DefaultImpls method of the superinterface. Otherwise the
|
||||
compatibility accessor will invoke the default method on the interface, with
|
||||
standard JVM runtime resolution semantics.
|
||||
Note that if interface delegation is used, all interface methods are delegated.
|
||||
The only exception are methods annotated with the deprecated @JvmDefault annotation.
|
||||
-Xjvm-default=all Generate default methods for all interface declarations with bodies.
|
||||
Do not generate DefaultImpls classes at all.
|
||||
BREAKS BINARY COMPATIBILITY if some client code relies on the presence of
|
||||
DefaultImpls classes. Also prohibits the produced binaries to be read by Kotlin
|
||||
compilers earlier than 1.4.
|
||||
Note that if interface delegation is used, all interface methods are delegated.
|
||||
The only exception are methods annotated with the deprecated @JvmDefault annotation.
|
||||
-Xjvm-default=disable Do not generate JVM default methods and prohibit @JvmDefault annotation usage.
|
||||
The following modes are DEPRECATED:
|
||||
-Xjvm-default=enable Allow usages of @JvmDefault; only generate the default method
|
||||
for annotated method in the interface
|
||||
(annotating an existing method can break binary compatibility)
|
||||
-Xjvm-default=compatibility Allow usages of @JvmDefault; generate a compatibility accessor
|
||||
in the 'DefaultImpls' class in addition to the default interface method
|
||||
|
||||
-Xklib=<path> Paths to cross-platform libraries in .klib format
|
||||
-Xno-call-assertions Don't generate not-null assertions for arguments of platform types
|
||||
-Xno-exception-on-explicit-equals-for-boxed-null
|
||||
|
||||
Reference in New Issue
Block a user