https://kotlinlang.org logo
#getting-started
Title
# getting-started
a

Ayla

12/06/2023, 7:58 AM
Can a declaration be restricted from being visible only within modules in the project when writing a library?
w

Wout Werkman

12/06/2023, 8:00 AM
That is exactly the internal modifier 🙂. https://kotlinlang.org/docs/visibility-modifiers.html#modules
e

ephemient

12/06/2023, 8:01 AM
internal
is for visibility within a single module
☝️ 3
if you want something to be visible to a group of modules, create a
@RequiresOptIn
annotation https://kotlinlang.org/docs/opt-in-requirements.html