mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-11 15:53:46 +00:00
Implement Java 9 module visibility checks
In this commit, only IDE tests are added, because we look for module declarations in the IDE across the whole project, whereas in the compiler we should do this on the module path only and that requires separate work (KT-18599) which is done in the following commits. (The change in Cache.kt is needed so that JvmModuleAccessibilityChecker.ClassifierUsage, which is an inner class, would be injected properly.) #KT-18598 In Progress #KT-18599 In Progress
This commit is contained in:
@@ -0,0 +1,7 @@
|
||||
package dependency;
|
||||
|
||||
import dependency.impl.JImpl;
|
||||
|
||||
public class J {
|
||||
public static JImpl getInstance() { return new JImpl(); }
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
package dependency
|
||||
|
||||
import dependency.impl.KImpl
|
||||
|
||||
open class K {
|
||||
companion object {
|
||||
fun getInstance(): KImpl = KImpl()
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
package dependency.impl;
|
||||
|
||||
import dependency.J;
|
||||
|
||||
public class JImpl extends J {
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
package dependency.impl
|
||||
|
||||
import dependency.K
|
||||
|
||||
class KImpl : K()
|
||||
@@ -0,0 +1,3 @@
|
||||
module library {
|
||||
exports dependency;
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
module main {
|
||||
requires library;
|
||||
}
|
||||
16
idea/testData/multiModuleHighlighting/java9/simpleLibraryExportsPackage/main/usage.kt
vendored
Normal file
16
idea/testData/multiModuleHighlighting/java9/simpleLibraryExportsPackage/main/usage.kt
vendored
Normal file
@@ -0,0 +1,16 @@
|
||||
import dependency.*
|
||||
import dependency.J
|
||||
import dependency.K
|
||||
import dependency.impl.*
|
||||
import dependency.impl.<error>JImpl</error>
|
||||
import dependency.impl.<error>KImpl</error>
|
||||
|
||||
fun usage(): String {
|
||||
val j: J = J.getInstance()
|
||||
val k: K = K.getInstance()
|
||||
|
||||
val jImpl: <error>JImpl</error> = J.getInstance()
|
||||
val kImpl: <error>KImpl</error> = K.getInstance()
|
||||
|
||||
return "$j$k$jImpl$kImpl"
|
||||
}
|
||||
Reference in New Issue
Block a user