Is there still no way in K2 to find whether an `Ir...
# compiler
n
Is there still no way in K2 to find whether an
IrFunction
/
IrClass
is
actual
? And reconcile with its
expect
counterpart. I’ve been using ObsoleteDescriptorBasedAPI but would like to migrate to something else. Use case - by linking the two declarations, plugins can: • be less strict, e.g. let users annotate either one of the two • given an actual fun, retrieve the default value for parameters. Can only be done through its
expect
counterpart
s
K2 requires annotations on expect/actual to match exactly and it should merge them before plugins are invoked, at least the backend (ir) part
1
n
Thanks a lot! Just tested it and even default values are merged. It’s way simpler now.
e
@shikasd but can an actual declaration carry more annotations? On top of the expect ones I mean.
s
I don't think so
e
But what if an annotation exists only on a specific platform
s
You have to type alias it iirc
I might be wrong, please check with the compiler yourself :)
e
Yeah I'll check no worries
n
Another problem is when you have
expect class
+
actual typealias
, and the annotation is not applicable to typealiases. If I remember correctly I only got a warning though.
e
I just got worried when I read your message lol