I'm trying to upgrade to Kotlin 1.6.21 but I keep ...
# compose-web
d
I'm trying to upgrade to Kotlin 1.6.21 but I keep getting this error no matter what version of compose-web I use (but mainly trying to get 1.2.0-alpha01-dev709 working)
Copy code
java.lang.IncompatibleClassChangeError: Found class org.jetbrains.kotlin.ir.types.IrType, but interface was expected
	at androidx.compose.compiler.plugins.kotlin.lower.decoys.WrapNotInlineableComposableLambdasForJs$wrapComposableLambdasInCall$mappedArguments$2.invoke(WrapNotInlineableComposableLambdasForJs.kt:142)
	at androidx.compose.compiler.plugins.kotlin.lower.decoys.WrapNotInlineableComposableLambdasForJs$wrapComposableLambdasInCall$mappedArguments$2.invoke(WrapNotInlineableComposableLambdasForJs.kt:135)

etc...
o
Do you have a reproducer sample? Is your project with the error available on github?
Could it be that you have kotlin 1.7.0 instead of 1.6.21 in your project? according to the exception: In 1.6.21 IrType used to be an interface https://github.com/JetBrains/kotlin/blob/v1.6.21/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/types/IrType.kt In 1.7.0 it became an abstract class https://github.com/JetBrains/kotlin/blob/v1.7.0/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/types/IrType.kt it would explain the incompatibility error
d
In my gradle config I have 1.6.21 specified, but it does seem to be trying to use 1.7.0 for some reason.
If I try to force gradle to resolve 1.6.21 for all Kotlin modules I get a different error
Copy code
FATAL ERROR: Could not find "...\.gradle\caches\modules-2\files-2.1\app.cash.sqldelight\sqljs-driver\2.0.0-SNAPSHOT\4f3b183e3f1c1b4797f9f186dc1ad2f60f0d87f5\sqljs-driver-2.0.0-SNAPSHOT.klib"
I checked and this file does exist, so I don't know why it gives this error. The sqljs-driver module depends on the Kotlin 1.7.0 stdlib so I wonder if that's why?
o
Could you please try with older sqljs-driver? we also have 0.0.0-on_kotlin_1.7.0-rc-dev705 build that should work with kotlin 1.7.0 (it has some known issues when a project has an android target though, but should fine to try with compose-web).
👍 2
d
If I downgrade SQLDelight and compile with 1.6.21 I get the following error instead:
Copy code
kotlin.NotImplementedError: An operation is not implemented: org.jetbrains.kotlin.ir.types.impl.IrDynamicTypeImpl@2712046a
	at org.jetbrains.kotlin.ir.descriptors.IrBasedDescriptorsKt.toIrBasedKotlinType(IrBasedDescriptors.kt:1137)
	at org.jetbrains.kotlin.ir.descriptors.IrBasedDescriptorsKt.makeKotlinType(IrBasedDescriptors.kt:1151)
	at org.jetbrains.kotlin.ir.descriptors.IrBasedDescriptorsKt.toIrBasedKotlinType(IrBasedDescriptors.kt:1136)
    ...
If I upgrade Kotlin, ksp, and compose for 1.7.0 I get this error:
Copy code
java.lang.AssertionError: Unexpected type: org.jetbrains.kotlin.ir.types.impl.IrDynamicTypeImpl@3c59468a = dynamic
	at org.jetbrains.kotlin.ir.descriptors.IrBasedDescriptorsKt.toIrBasedKotlinType(IrBasedDescriptors.kt:1142)
	at org.jetbrains.kotlin.ir.descriptors.IrBasedDescriptorsKt.makeKotlinType(IrBasedDescriptors.kt:1157)
	at org.jetbrains.kotlin.ir.descriptors.IrBasedDescriptorsKt.toIrBasedKotlinType(IrBasedDescriptors.kt:1134)
    ...
🤔 2
o
🙏 1
d
After some trial and error, I was able to determine that the error is caused by having an
Array<dynamic>
parameter in an
@Composable
function
Copy code
@Composable
fun Example(array: Array<dynamic>) {}
124 Views