[MPP] Fix default parameter value for optimistic commonization in KGP
KT-51332
This commit is contained in:
+10
@@ -143,6 +143,16 @@ class CommonizerHierarchicalIT : BaseGradleIT() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
fun `test KT-51332 optimistic commonization`() {
|
||||||
|
with(Project("optimisticCommonization")) {
|
||||||
|
build(":compileCommonMainKotlinMetadata") {
|
||||||
|
assertNotContains("Unresolved reference")
|
||||||
|
assertSuccessful()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private object Os {
|
private object Os {
|
||||||
private val os = OperatingSystem.current()
|
private val os = OperatingSystem.current()
|
||||||
val canCompileApple get() = os.isMacOsX
|
val canCompileApple get() = os.isMacOsX
|
||||||
|
|||||||
+21
@@ -0,0 +1,21 @@
|
|||||||
|
plugins {
|
||||||
|
kotlin("multiplatform")
|
||||||
|
}
|
||||||
|
|
||||||
|
repositories {
|
||||||
|
mavenCentral()
|
||||||
|
mavenLocal()
|
||||||
|
}
|
||||||
|
|
||||||
|
kotlin {
|
||||||
|
linuxArm32Hfp("intPlatform") {
|
||||||
|
compilations.get("main").cinterops.create("intPropertyInterop") {
|
||||||
|
header(file("libs/intPlatform.h"))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
linuxX64("longPlatform") {
|
||||||
|
compilations.get("main").cinterops.create("intPropertyInterop") {
|
||||||
|
header(file("libs/longPlatform.h"))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
+1
@@ -0,0 +1 @@
|
|||||||
|
kotlin.mpp.enableCInteropCommonization=true
|
||||||
+1
@@ -0,0 +1 @@
|
|||||||
|
int unsafeProp;
|
||||||
+1
@@ -0,0 +1 @@
|
|||||||
|
long long unsafeProp;
|
||||||
+3
@@ -0,0 +1,3 @@
|
|||||||
|
fun testCommon() {
|
||||||
|
intPropertyInterop.unsafeProp
|
||||||
|
}
|
||||||
+1
-1
@@ -219,7 +219,7 @@ internal class PropertiesProvider private constructor(private val project: Proje
|
|||||||
get() = booleanProperty(KotlinMultiplatformPlugin.STABILITY_NOWARN_FLAG)
|
get() = booleanProperty(KotlinMultiplatformPlugin.STABILITY_NOWARN_FLAG)
|
||||||
|
|
||||||
val mppEnableOptimisticNumberCommonization: Boolean
|
val mppEnableOptimisticNumberCommonization: Boolean
|
||||||
get() = booleanProperty(KOTLIN_MPP_ENABLE_OPTIMISTIC_NUMBER_COMMONIZATION) ?: false
|
get() = booleanProperty(KOTLIN_MPP_ENABLE_OPTIMISTIC_NUMBER_COMMONIZATION) ?: true
|
||||||
|
|
||||||
val wasmStabilityNoWarn: Boolean
|
val wasmStabilityNoWarn: Boolean
|
||||||
get() = booleanProperty("kotlin.wasm.stability.nowarn") ?: false
|
get() = booleanProperty("kotlin.wasm.stability.nowarn") ?: false
|
||||||
|
|||||||
Reference in New Issue
Block a user