I can't define actual typealas for JVM's AtomicRef...
# multiplatform
a
I can't define actual typealas for JVM's AtomicReference: commonMain:
expect class AtomicReference<T>(value: T)
jvmMain:
actual typealias AtomicReference<T> = java.util.concurrent.atomic.AtomicReference<T>
In Kotlin docs it's stated as possible. Is it so by design?
Not sure what’s wrong but that’s what we’re doing
a
Mine is same, and does not work 😞
The error is:
The following declaration is incompatible because names of type parameters are different
public constructor AtomicReference<V : Any!>(p0: V!)
Do I need sources for this?
k
Have you tried to compile it? Sometimes Intellij has errors that the compiler does not.
a
Ahh, names of
type
parameters!
Changed
T
to
V
in common and now it's fine
k
Interesting
a
Then it does not work for Native) Because AtomicReference has type parameter named
T
not
V
k
I don't typealias native.
a
I would like to