Generate version requirement on inline functions since API version 1.4
The old compiler will crash if it tries to inline a function that's passing a lambda parameter into the new parameter null check method `Intrinsics.checkNotNullParameter` because that usage is not considered as inlinable by the old compiler (it only knows about `Intrinsics.checkParameterIsNotNull`). Therefore we require that these functions can only be read by compilers of version 1.3.50 or greater. #KT-22275 Fixed
This commit is contained in:
@@ -40,7 +40,10 @@ class JvmVersionRequirementTest : AbstractVersionRequirementTest() {
|
||||
languageVersionSettings = LanguageVersionSettingsImpl(
|
||||
languageVersion,
|
||||
ApiVersion.createByLanguageVersion(languageVersion),
|
||||
mapOf(JvmAnalysisFlags.jvmDefaultMode to JvmDefaultMode.ENABLE),
|
||||
mapOf(
|
||||
JvmAnalysisFlags.jvmDefaultMode to JvmDefaultMode.ENABLE,
|
||||
AnalysisFlags.explicitApiVersion to true
|
||||
),
|
||||
emptyMap()
|
||||
)
|
||||
},
|
||||
@@ -73,4 +76,16 @@ class JvmVersionRequirementTest : AbstractVersionRequirementTest() {
|
||||
fqNames = listOf("test.Base.Companion.foo")
|
||||
)
|
||||
}
|
||||
|
||||
fun testInlineParameterNullCheck() {
|
||||
doTest(
|
||||
VersionRequirement.Version(1, 3, 50), DeprecationLevel.ERROR, null, COMPILER_VERSION, null,
|
||||
fqNames = listOf(
|
||||
"test.doRun",
|
||||
"test.lambdaVarProperty",
|
||||
"test.extensionProperty"
|
||||
),
|
||||
customLanguageVersion = LanguageVersion.KOTLIN_1_4
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user