Do not set api version to language version when language version is null
#KT-21852 fixed
#KT-21574 fixed
This commit is contained in:
@@ -16,6 +16,7 @@
|
||||
|
||||
package org.jetbrains.kotlin.cli.common.arguments
|
||||
|
||||
import com.intellij.util.text.VersionComparatorUtil
|
||||
import java.util.*
|
||||
import kotlin.reflect.KClass
|
||||
import kotlin.reflect.KMutableProperty1
|
||||
@@ -98,4 +99,10 @@ fun <T : Any> collectProperties(kClass: KClass<T>, inheritedOnly: Boolean): List
|
||||
return properties.filter {
|
||||
it.visibility == KVisibility.PUBLIC && it.findAnnotation<Transient>() == null
|
||||
}
|
||||
}
|
||||
|
||||
fun CommonCompilerArguments.setApiVersionToLanguageVersionIfNeeded() {
|
||||
if (languageVersion != null && VersionComparatorUtil.compare(languageVersion, apiVersion) < 0) {
|
||||
apiVersion = languageVersion
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user