I've got an `expect class` that maps to a `typeali...
# javascript
e
I've got an
expect class
that maps to a
typealias
.
Copy code
// commonMain
public expect class MyByteArray(size: Int)

// jsMain
public actual typealias MyByteArray = Uint8Array
The
Uint8Array
class comes from kotlin-wrappers. Now, every time I use
MyByteArray
in a
JsExport
-ed definition in
commonMain
, I also have to annotate it with
Copy code
@Suppress("NON_EXPORTABLE_TYPE")
Otherwise the IDE complains about it, as per screenshot. I suppose it's an IDE-only issue as I don't see any warning at compile time. Anyone else noticed this?
h
Sound like a Kotin IntelliJ plugin issue to me, which does not resolve the typealias when creating the inspection.
e
Yeah looks like that to me too. Haven't found a similar issue on YouTrack, so maybe it's worth creating it.
The problem with annotating stuff with
@Suppress("NON_EXPORTABLE_TYPE")
is you risk having TS types generated as
any
without knowing it.