https://kotlinlang.org logo
#compose-ios
Title
# compose-ios
x

xxfast

03/06/2023, 6:08 AM
Hi all - im running into this issue and wondering if this has already being brought up
Copy code
> Task :core:ui:compileKotlinIosSimulatorArm64
e: Compilation failed: IrBasedSimpleFunctionDescriptor: FUN name:AlertDialog visibility:public modality:FINAL <> (visible:kotlin.Boolean, onDismissRequest:kotlin.Function0<kotlin.Unit>,
 * Source files: ..

e: java.lang.IllegalStateException: IrBasedSimpleFunctionDescriptor: FUN name:AlertDialog visibility:public modality:FINAL <> (visible:kotlin.Boolean, onDismissRequest:kotlin.Function0<kotlin.Unit>, [expect]
	at org.jetbrains.kotlin.backend.konan.lower.ExpectToActualDefaultValueCopier$copyDefaultArgumentsFromExpectToActual$1.visitValueParameter(ExpectDeclarationsRemoving.kt:229)
	at org.jetbrains.kotlin.ir.visitors.IrElementVisitorVoid$DefaultImpls.visitValueParameter(IrElementVisitorVoid.kt:107)
	at org.jetbrains.kotlin.backend.konan.lower.ExpectToActualDefaultValueCopier$copyDefaultArgumentsFromExpectToActual$1.visitValueParameter(ExpectDeclarationsRemoving.kt:64)
	at org.jetbrains.kotlin.backend.konan.lower.ExpectToActualDefaultValueCopier$copyDefaultArgumentsFromExpectToActual$1.visitValueParameter(ExpectDeclarationsRemoving.kt:64)
	at org.jetbrains.kotlin.ir.declarations.IrValueParameter.accept(IrValueParameter.kt:42)
	at org.jetbrains.kotlin.ir.declarations.IrFunction.acceptChildren(IrFunction.kt:52)
	at org.jetbrains.kotlin.ir.visitors.IrVisitorsKt.acceptChildrenVoid(IrVisitors.kt:15)
All the files affected expose an
@Composable
expect
function
o

Oleksandr Karpovich [JB]

03/06/2023, 6:53 AM
The stack trace mentions the default values in expect functions. Could you please confirm that those expect Composable functions have default values for parameters? It's a known thing that wasn't fixed properly. As a workaround you may spilt one expect fun into several overloads. It's more of less easy if you have 1 or 2 parameter(s) with a default value, but becomes a problem if there's more such parameters.
x

xxfast

03/06/2023, 7:34 AM
Yes, they do contain default arguments - is there an issue open for this already? Couldn't find this specific one
o

Oleksandr Karpovich [JB]

03/06/2023, 7:56 AM
26 Views