Generate 'DefaultImpls' for jvm 8 target only within compiler option

This commit is contained in:
Michael Bogdanov
2016-09-12 12:05:45 +03:00
parent ca41f01468
commit dd4d5e3aa1
15 changed files with 145 additions and 26 deletions
@@ -139,6 +139,17 @@ class K2JVMCompiler : CLICompiler<K2JVMCompilerArguments>() {
}
}
if (arguments.interfaceCompatibility) {
val target = configuration.get(JVMConfigurationKeys.JVM_TARGET)
if (target != JvmTarget.JVM_1_8) {
val errorMessage = "The -Xinterface-compatibility option has effect only for JVM target bytecode version 1.8."
messageCollector.report(CompilerMessageSeverity.WARNING, errorMessage, CompilerMessageLocation.NO_LOCATION)
}
else {
configuration.put(JVMConfigurationKeys.INTERFACE_COMPATIBILITY, true)
}
}
putAdvancedOptions(configuration, arguments)
messageCollector.report(CompilerMessageSeverity.LOGGING, "Configuring the compilation environment", CompilerMessageLocation.NO_LOCATION)