Nino
01/26/2024, 11:08 AMSam
01/26/2024, 11:13 AMpublic modifier required—that is, it stops you from making things public by accident—but I don't think it will make things internal by default 😞.Nino
01/26/2024, 11:17 AMVisibility modifiers are required for declarations if the default visibility exposes them to the public API. Since the default visiblity is public, they will always be exposed to the public API, won't they ?Sam
01/26/2024, 11:23 AMprivate class Foo {
val bar = "bar"
}
would still be allowed, since bar is not visible from outside even though it has no modifiers. I haven't used that mode myself, though, so maybe someone else can correct me.Nino
01/26/2024, 11:24 AMCLOVIS
01/26/2024, 1:34 PMpublic . If you use explicit API mode, there is no default visibility.
You can write a library without using explicit API mode, if you want to keep public as the default.
I don't think you can set another visibility as the default.