Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
As I'm writing in Python, where such feature isn't supported either: Why is this essential?
-
@sbiewald Because you might have internal constructors that should not be used by anything other than the classnitself.
-
On another note, I am literally typing all my comments blindly because my display is fucked.
-
Anyway: https://stackoverflow.com/questions...
Companion objects are an interesting hack for this. -
Package private visibility was always a bit hacky even in Java tbh - especially since packages aren't hierarchical (an inherent Java design flaw IMHO.)
The modern, "nicer" way to do this would be for Kotlin to support the Java 9 module system, but that opens up a whole other can of worms...
Holy shit, Kotlin does not have package-private?! I thought Kotlin was just a bad mix of JS syntax and Java... but not supporting an essential feature of the VM is on a whole another level of bad.
rant