Postpone JvmDefault deprecation. Revert "Deprecate @JvmDefault"

This reverts commit c11f3868
This commit is contained in:
Mikhail Bogdanov
2020-05-04 09:53:26 +02:00
parent 911dfde0fe
commit 4f7599076c
19 changed files with 57 additions and 73 deletions
@@ -289,7 +289,6 @@ class K2JVMCompilerArguments : CommonCompilerArguments() {
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)
@@ -363,12 +362,6 @@ class K2JVMCompilerArguments : CommonCompilerArguments() {
result[AnalysisFlags.ignoreDataFlowInAssert] = JVMAssertionsMode.fromString(assertionsMode) != JVMAssertionsMode.LEGACY
JvmDefaultMode.fromStringOrNull(jvmDefault)?.let {
result[JvmAnalysisFlags.jvmDefaultMode] = it
if (it == JvmDefaultMode.ENABLE || it == JvmDefaultMode.ENABLE_WITH_DEFAULT_IMPLS) {
collector.report(
CompilerMessageSeverity.WARNING,
"'-Xjvm-default=$jvmDefault' mode is deprecated. Please considering to switch to new modes: 'all' and 'all-compatibility'"
)
}
} ?: collector.report(
CompilerMessageSeverity.ERROR,
"Unknown @JvmDefault mode: $jvmDefault, " +