https://kotlinlang.org logo
#javascript
Title
# javascript
e

Edoardo Luppi

10/13/2023, 1:17 PM
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

hfhbd

10/13/2023, 1:20 PM
Sound like a Kotin IntelliJ plugin issue to me, which does not resolve the typealias when creating the inspection.
e

Edoardo Luppi

10/13/2023, 1:22 PM
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.