Fix incorrect behavior and refactor JvmModuleAccessibilityChecker

Previously we assumed that a symbol is accessible if its containing
package is exported by module-info.java. Which was obviously wrong and
could lead to a situation where a symbol would be incorrectly accessible
if a usage module has a dependency on the symbol's module in IDEA
project terms, but does not require it in its module-info.java

 #KT-18598 In Progress
This commit is contained in:
Alexander Udalov
2017-06-28 01:08:05 +03:00
parent 2d3888c710
commit 8768500844
6 changed files with 29 additions and 13 deletions
@@ -0,0 +1,3 @@
package foo;
public class Foo {}
@@ -0,0 +1,3 @@
module dependency {
exports foo;
}
@@ -0,0 +1,3 @@
module main {
// does not require dependency
}
@@ -0,0 +1,5 @@
import foo.<error>Foo</error>
fun usage() {
<error>Foo</error>()
}