Ayla
07/03/2023, 2:05 PMexpect/actual
as follows:
//common
expect class PlatformElement
//android
//works
actual typealias PlatformElement = View
//js
//error:The following declaration is incompatible because modality is different
actual typealias PlatformElement = HTMLElement
I found HTMLElement is abstract
, so it fails. But I won't use the constrcutor, I just want to declare the type, so what should I do ?jw
07/03/2023, 2:11 PMAyla
07/03/2023, 2:29 PMLuv Kumar
07/20/2025, 11:54 AM// commonMain
expect class PlatformStream
// iosMain
actual typealias PlatformStream = NSInputStream
// androidMain
actual typealias PlatformStream = InputStream
could you guys share how can i suppress it ? i tried something like
@Suppress("ACTUAL_WITHOUT_EXPECT")
actual typealias PlatformReadStream = InputStream
doing above idea removes the compilation warning but doing ./gradlew build -x check
still give following error `Expect declaration PlatformReadStream
is incompatible with actual PlatformReadStream
because modality is different. Expect declaration modality is 'final'. Actual declaration modality is 'abstract'`