Why is it not possible to declare a typealias to CPointer<T> for expect declaration? e.g.
Copy code
expect class Image
actual typealias Image = platform.CoreVideo.CVPixelBufferRef // iOS - 'declaration is incompatible because number of type parameters is different'
d
Dominaezzz
05/10/2019, 8:58 AM
That's very unlikely to be compatible.
Dominaezzz
05/10/2019, 8:59 AM
What other `actual`s do you have for that
expect
.
p
Paul Idstein
05/10/2019, 9:20 AM
I have a common part and an actual iOS and Android part
actual for Android looks like this:
Copy code
actual typealias Image = Bitmap
s
Sam
05/10/2019, 11:34 AM
CVPixelBufRef is very low level. You probably want to work with a higher level abstraction like CgImage or UIImage.
p
Paul Idstein
05/10/2019, 11:54 AM
I can not and do not want to in our case we try to wrap ARFrame’s capturedImage
r
russhwolf
05/10/2019, 12:34 PM
From the error it looks like it’s because
CPointer<T>
has a generic argument and your
expect
declaration and other `actual`s don’t. An
actual typealias
is extremely strict about how closely it must match the
expect
. It’s often more flexible to use a wrapper class instead.