JVM IR: do not lower trimIndent/trimMargin if API version is too high
We cannot be sure that we won't change behavior of these functions in some corner cases, so only perform this optimization if the API version specified by the user is not greater than the compiler's own stdlib version it was compiled against. This is the same as the similar code in the old backend in IntrinsicMethods.
This commit is contained in:
@@ -210,10 +210,10 @@ class GenerationState private constructor(
|
||||
target,
|
||||
isIrBackend
|
||||
)
|
||||
val canReplaceStdlibRuntimeApiBehavior = languageVersionSettings.apiVersion <= ApiVersion.parse(KotlinVersion.CURRENT.toString())!!
|
||||
val intrinsics: IntrinsicMethods = run {
|
||||
val shouldUseConsistentEquals = languageVersionSettings.supportsFeature(LanguageFeature.ThrowNpeOnExplicitEqualsForBoxedNull) &&
|
||||
!configuration.getBoolean(JVMConfigurationKeys.NO_EXCEPTION_ON_EXPLICIT_EQUALS_FOR_BOXED_NULL)
|
||||
val canReplaceStdlibRuntimeApiBehavior = languageVersionSettings.apiVersion <= ApiVersion.parse(KotlinVersion.CURRENT.toString())!!
|
||||
IntrinsicMethods(target, canReplaceStdlibRuntimeApiBehavior, shouldUseConsistentEquals)
|
||||
}
|
||||
val samWrapperClasses: SamWrapperClasses = SamWrapperClasses(this)
|
||||
|
||||
Reference in New Issue
Block a user