JS: support internal visibility from friend modules
Friend modules should be provided using the -Xfriend-modules flag
in the same format as -libraries. No manual configuration required for
JPS, Gradle and Maven plugins.
Friend modules could be switched off using the -Xfriend-modules-disabled
flag. Doing that will
* prevent internal declarations from being exported,
* values provided by -Xfriend-modules ignored,
* raise a compilation error on attemps to use internal declarations from other modules
Fixes #KT-15135 and #KT-16568.
Original commit: 2e9a59819a
This commit is contained in:
+33
@@ -0,0 +1,33 @@
|
||||
@file:InternalFileAnnotation1
|
||||
|
||||
package test2
|
||||
|
||||
import test1.*
|
||||
|
||||
internal class FromInternalClass1: InternalClass1()
|
||||
|
||||
@InternalClassAnnotation1
|
||||
class FromClassA1 : ClassA1(10) {
|
||||
@InternalClassAnnotation1
|
||||
class Nested {
|
||||
@InternalFunctionAnnotation1
|
||||
fun foo() {}
|
||||
}
|
||||
}
|
||||
|
||||
class FromClassB1 : ClassB1() {
|
||||
internal override val member = 10
|
||||
}
|
||||
|
||||
@InternalFunctionAnnotation1
|
||||
fun foo() {}
|
||||
|
||||
fun box() {
|
||||
internalProp
|
||||
internalFun()
|
||||
|
||||
InternalClass1()
|
||||
FromClassA1().member
|
||||
FromClassB1().member
|
||||
FromClassB1().func()
|
||||
}
|
||||
Reference in New Issue
Block a user