https://kotlinlang.org logo
Title
h

Huixing.Wang

11/04/2021, 2:46 AM
Hello, when i use kmp expect fun and put a modifier as default param, but it run with a NPE,Anyone know why?
m

Mimao

11/04/2021, 3:42 AM
having the same issue here😖
l

len

11/04/2021, 10:20 AM
You can't have default parameters in expect/actual composable functions yet. The workaround is to create a function in common code with the default arguments that calls the expect function providing it all the parameters. See here for more info: https://github.com/JetBrains/compose-jb/issues/758
👍 1
o

olonho

11/04/2021, 10:51 AM
shall work in
1.0.0-beta5
m

Mimao

11/04/2021, 11:16 AM
@olonho I tested with 1.0.0-beta5 also throws this error
Parameter specified as non-null is null: method kotlin.jvm.internal.Intrinsics.checkNotNullParameter, parameter modifier
l

len

11/04/2021, 11:16 AM
I'm using
beta5
and still doesn't work for me on both desktop & android 🤔
Oh, you beat me by a second 😂
😂 2
o

olonho

11/04/2021, 11:18 AM
cc @shikasd
@Oleksandr Karpovich [JB] maybe you got the idea?
o

Oleksandr Karpovich [JB]

11/08/2021, 8:36 AM
No ideas at the moment unfortunately. I'll dig into this