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:
2
idea/testData/multiModuleHighlighting/java9/declarationKinds/dependency/module-info.java
vendored
Normal file
2
idea/testData/multiModuleHighlighting/java9/declarationKinds/dependency/module-info.java
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
module dependency {
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
package unexported
|
||||
|
||||
class Klass
|
||||
interface Interface
|
||||
|
||||
typealias TypeAliasToPublic = String
|
||||
typealias TypeAliasToUnexported = Klass
|
||||
|
||||
fun function() {}
|
||||
|
||||
val valProperty = ""
|
||||
var varProperty = ""
|
||||
3
idea/testData/multiModuleHighlighting/java9/declarationKinds/main/module-info.java
vendored
Normal file
3
idea/testData/multiModuleHighlighting/java9/declarationKinds/main/module-info.java
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
module main {
|
||||
requires dependency;
|
||||
}
|
||||
17
idea/testData/multiModuleHighlighting/java9/declarationKinds/main/usage.kt
vendored
Normal file
17
idea/testData/multiModuleHighlighting/java9/declarationKinds/main/usage.kt
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
import unexported.*
|
||||
|
||||
fun usage(): String {
|
||||
val k: <error>Klass</error> = <error>Klass</error>()
|
||||
val i: <error>Interface</error>? = null
|
||||
|
||||
val ta1: <error>TypeAliasToPublic</error> = <error>TypeAliasToPublic</error>()
|
||||
val ta2: <error>TypeAliasToUnexported</error> = <error>TypeAliasToUnexported</error>()
|
||||
|
||||
<error>function</error>()
|
||||
|
||||
<error>valProperty</error>
|
||||
<error>varProperty</error>
|
||||
<error>varProperty</error> = ""
|
||||
|
||||
return "$k$i$ta1$ta2"
|
||||
}
|
||||
Reference in New Issue
Block a user