I am struggling with StringBuilder. I have a commo...
# multiplatform
r
I am struggling with StringBuilder. I have a common module which uses StringBuilder but I cannot call the function from the JVM module since
java.lang.StringBuilder
does not seem to be the actual type of it. What is the actual type in JVM?
k
Can you post expect/actual code?
r
I have no expect/actual, I am having something like:
Copy code
fun foo(sb: StringBuilder){}
in common module and I want to call it from jvm module
k
Where is the common
StringBuilder
decared?
r
kotlin.text.StringBuilder
Unfortunately I cannot search for implementations or rather intellij does not find them
it seems like they missed to add
actual
to the type alias
kotlin.text.StringBuilder
in the JVM module
k
Intellij doesn't see it, but doing a gradle build works
In common, I have a var declared as follows:
var sb : StringBuilder = StringBuilder()
In jvm:
sb = java.lang.StringBuilder()
Intellij flags it, but it'll compile
r
oh... interesting, I'll try it out
you're right, works perfectly fine, I'll file a bug
k
👍