Alex Craft
Alex Craft

Reputation: 15336

How to export some functions from another package in Kotlin?

There are two packages bon and bon.internal

There's inspect function defined in bon.internal.

I would like to export as if it's in the bon package, something like

package bon

export bon.internal.inspect as inspect

Is that possible?

Upvotes: 1

Views: 1647

Answers (1)

Alexey Romanov
Alexey Romanov

Reputation: 170745

No, it isn't. You have to redefine it

fun inspect(arg1: Type1, ...) = bon.internal.inspect(arg1, ...)

or to define it as part of bon package in the first place.

Scala 3 (not yet released) supports this, I don't think there are any plans for Kotlin.

Upvotes: 1

Related Questions