Create an account

Very important

  • To access the important data of the forums, you must be active in each forum and especially in the leaks and database leaks section, send data and after sending the data and activity, data and important content will be opened and visible for you.
  • You will only see chat messages from people who are at or below your level.
  • More than 500,000 database leaks and millions of account leaks are waiting for you, so access and view with more activity.
  • Many important data are inactive and inaccessible for you, so open them with activity. (This will be done automatically)


Thread Rating:
  • 194 Vote(s) - 3.46 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Scope of internal visibility modifier in Kotlin

#1
I have a problem understanding the internal access modifier. In my examples I could not produce any situation where it behaves different then public. Even if I create a jars I can access the internal functions in the jar from outside the jar (from a different package unrelated to the one used in the jar). In the documentation the term module is used but I could not find out what a module is exactly.

My questions thus are:

1. what is a module in kotlin?

2. how does the access modifier internal differs from the public modiefier?
Reply

#2
The Kotlin compiler version M8 (0.8.11) ignores modules, more precisely, it works as if all your code were put into the same module, this is why you can't get a visibility error for `internal`.

Starting with the next milestone release, every IDE module you create has its own visibility scope, and when you try to access an `internal` declaration from one module in another, you get an error. Publics, on the other hand, are visible across the whole project.

**UPDATE**: This has not been turned on in M8, postponed for later

**UPDATE**: This has been turned on since [later Kotlin milestones and betas](

[To see links please register here]

)
Reply



Forum Jump:


Users browsing this thread:
1 Guest(s)

©0Day  2016 - 2023 | All Rights Reserved.  Made with    for the community. Connected through