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:
Vendored
+26
@@ -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
|
||||
+2
@@ -0,0 +1,2 @@
|
||||
module1->
|
||||
module2->module1
|
||||
Vendored
+19
@@ -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() {
|
||||
}
|
||||
+19
@@ -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() {
|
||||
}
|
||||
Vendored
+7
@@ -0,0 +1,7 @@
|
||||
package b
|
||||
|
||||
class B
|
||||
|
||||
fun b(param: a.A) {
|
||||
a.a()
|
||||
}
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
@file:InternalFileAnnotation
|
||||
package b
|
||||
|
||||
import a.InternalFileAnnotation
|
||||
import a.InternalClassAnnotation
|
||||
|
||||
@InternalClassAnnotation
|
||||
class B
|
||||
|
||||
fun b(param: a.InternalA) {
|
||||
a.internalA()
|
||||
}
|
||||
Vendored
+5
@@ -0,0 +1,5 @@
|
||||
package c
|
||||
|
||||
fun c() {
|
||||
// This file doesn't use anything from module1, so it won't be recompiled after change
|
||||
}
|
||||
Reference in New Issue
Block a user