Is there a way in Kotlin, when I import something ...
# announcements
n
Is there a way in Kotlin, when I import something into a package, to make it so that it in turn becomes available for import from that package? e.g. say my package
foo
imports
bar.blub
, i want it to to be so that if somoene does
import foo.*
they also get blub.
s
Nope
👆 1
Which is good, if you ask me. Way less ambiguity.
n
In most cases, sure. But in some cases it fan be annoying.
There is such a concept as a public dependency, whether Kotlin gives you a way to express it or not
l
IDE autocompletes every package tho... I barely know which package resides my dependencies
☝️ 1
What's your usecase here?
n
The use case is that I wanted to add a sort of prelude of my own, that consistently imports things
Ideally, without any import, but having accepted that I need to import, I'd prefer it at least to be a one liner
import prelude.*
but this will only allow importing all the things defined in this one package
package/module
f
You should be able to use type aliases to achieve that. You're probably coming from Rust with this. The visibility system of Rust has many more possibilities compared to Kotlin and you'll notice that many things you can do there are impossible here.