https://kotlinlang.org logo
#multiplatform
Title
# multiplatform
a

Arkadii Ivanov

09/12/2019, 4:50 PM
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

Arkadii Ivanov

09/12/2019, 5:04 PM
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

kpgalligan

09/12/2019, 5:06 PM
Have you tried to compile it? Sometimes Intellij has errors that the compiler does not.
a

Arkadii Ivanov

09/12/2019, 5:06 PM
Ahh, names of
type
parameters!
Changed
T
to
V
in common and now it's fine
k

kpgalligan

09/12/2019, 5:10 PM
Interesting
a

Arkadii Ivanov

09/12/2019, 5:12 PM
Then it does not work for Native) Because AtomicReference has type parameter named
T
not
V
k

kpgalligan

09/12/2019, 5:12 PM
I don't typealias native.
a

Arkadii Ivanov

09/12/2019, 5:12 PM
I would like to
2 Views