i have an expect class like so ```expect class Vid...
# multiplatform
y
i have an expect class like so
Copy code
expect class VideoTrack
its actual in android looks like this
Copy code
import org.webrtc.VideoTrack

actual typealias VideoTrack = VideoTrack
and I get this error when ever I run, it says to check my definition but the class is defined for all of my platfroms
c
Yeah that won't work, there is not actual implementation, typealias is literally just a different name for the same type
// common
Copy code
expect class VideoTrack {
 abstract fun start()
 abstract fun stop()
}
// android
Copy code
actual class VideoTrack {
  val impl = org.webrtc.VideoTrack()
  override fun start() = impl.start()
  override fun stop() = impl.stop()
}
But you do need to add the expect functions in the expect class in commonmain
From commonmain view, the expect class has no functions.
c
Interesting, not sure how that works as commonMain wouldn't be able to resolve that platform type. probably helps in cases like that extention function, very specific use case tho.
h
K2: Commonmain does not resolve the platform type at all, that’s why you need to write the expect functions
👍 1