fix KT-9299 In a project with circular dependencies between modules, IDE reports error on use of internal class from another module, but the corresponding code still compiles and runs.

#KT-9299 Fixed
This commit is contained in:
Michael Nedzelsky
2015-10-06 16:23:37 +03:00
parent 17b275af23
commit 6ebe0c30ec
23 changed files with 270 additions and 21 deletions
@@ -0,0 +1,26 @@
Cleaning output files:
out/production/module1/META-INF/module1.kotlin_module
out/production/module1/a/A.class
out/production/module1/a/InternalA.class
out/production/module1/a/InternalClassAnnotation.class
out/production/module1/a/InternalFileAnnotation.class
out/production/module1/a/Module1_aKt.class
End of files
Compiling files:
module1/src/module1_a.kt
End of files
Cleaning output files:
out/production/module2/META-INF/module2.kotlin_module
out/production/module2/b/B.class
out/production/module2/b/Module2_bKt.class
End of files
Compiling files:
module2/src/module2_b.kt
End of files
COMPILATION FAILED
Cannot access 'InternalFileAnnotation': it is 'internal' in 'a'
Cannot access 'InternalFileAnnotation': it is 'internal' in 'a'
Cannot access 'InternalClassAnnotation': it is 'internal' in 'a'
Cannot access 'InternalClassAnnotation': it is 'internal' in 'a'
Unresolved reference: InternalA
Unresolved reference: internalA
@@ -0,0 +1,2 @@
module1->
module2->module1
@@ -0,0 +1,19 @@
package a
@Target(AnnotationTarget.FILE)
@Retention(AnnotationRetention.SOURCE)
internal annotation class InternalFileAnnotation()
@Target(AnnotationTarget.CLASS)
@Retention(AnnotationRetention.SOURCE)
internal annotation class InternalClassAnnotation()
class A
internal class InternalA
fun a() {
}
internal fun internalA() {
}
@@ -0,0 +1,19 @@
package a
@Target(AnnotationTarget.FILE)
@Retention(AnnotationRetention.SOURCE)
internal annotation class InternalFileAnnotation()
@Target(AnnotationTarget.CLASS)
@Retention(AnnotationRetention.SOURCE)
internal annotation class InternalClassAnnotation()
class A
internal class AA
fun a() {
}
internal fun aa() {
}
@@ -0,0 +1,7 @@
package b
class B
fun b(param: a.A) {
a.a()
}
@@ -0,0 +1,12 @@
@file:InternalFileAnnotation
package b
import a.InternalFileAnnotation
import a.InternalClassAnnotation
@InternalClassAnnotation
class B
fun b(param: a.InternalA) {
a.internalA()
}
@@ -0,0 +1,5 @@
package c
fun c() {
// This file doesn't use anything from module1, so it won't be recompiled after change
}