https://kotlinlang.org logo
a

aleksey.tomin

12/04/2020, 4:08 AM
In java exists some library with some class and interface. I’ve created except/actual interface in kotlin-multiplatform. And my interface is the same as jvm interface. Can I join my expect kotlin interface and jvm actual interface/class?
r

rnett

12/04/2020, 4:16 AM
Actual typealias maybe?
a

aleksey.tomin

12/04/2020, 6:01 AM
It works!
Copy code
expect class AtomicReference<T>(value: T) { 
  var value: T 
}
Copy code
actual typealias AtomicReference<T> = kotlin.native.concurrent.AtomicReference<T>
😄 PS: All parameter names must be the same as names in the “base” class.
2 Views