ModuleDescriptor now sees internals of its expected by #KT-15739 Fixed

This commit is contained in:
Mikhail Glukhikh
2018-03-02 16:54:41 +03:00
parent 0c4c9251d6
commit 442a89bc6c
4 changed files with 18 additions and 7 deletions
@@ -115,7 +115,7 @@ class ModuleDescriptorImpl @JvmOverloads constructor(
} }
override fun shouldSeeInternalsOf(targetModule: ModuleDescriptor): Boolean { override fun shouldSeeInternalsOf(targetModule: ModuleDescriptor): Boolean {
return this == targetModule || targetModule in dependencies!!.modulesWhoseInternalsAreVisible return this == targetModule || targetModule in dependencies!!.modulesWhoseInternalsAreVisible || expectedByModule == targetModule
} }
private val id: String private val id: String
@@ -0,0 +1,3 @@
expect fun foo()
internal fun bar() {}
@@ -0,0 +1,3 @@
actual fun foo() {
bar() // should work
}
@@ -63,6 +63,10 @@ class MultiPlatformHighlightingTest : AbstractMultiModuleHighlightingTest() {
doMultiPlatformTest(TargetPlatformKind.Jvm[JvmTarget.JVM_1_6]) doMultiPlatformTest(TargetPlatformKind.Jvm[JvmTarget.JVM_1_6])
} }
fun testInternal() {
doMultiPlatformTest(TargetPlatformKind.Jvm[JvmTarget.JVM_1_6])
}
fun testSuppressHeaderWithoutImpl() { fun testSuppressHeaderWithoutImpl() {
doMultiPlatformTest(TargetPlatformKind.Jvm[JvmTarget.JVM_1_6]) doMultiPlatformTest(TargetPlatformKind.Jvm[JvmTarget.JVM_1_6])
} }
@@ -77,12 +81,13 @@ class MultiPlatformHighlightingTest : AbstractMultiModuleHighlightingTest() {
fun testUseCorrectBuiltInsForCommonModule() { fun testUseCorrectBuiltInsForCommonModule() {
doMultiPlatformTest(TargetPlatformKind.Jvm[JvmTarget.JVM_1_8], TargetPlatformKind.JavaScript, doMultiPlatformTest(TargetPlatformKind.Jvm[JvmTarget.JVM_1_8], TargetPlatformKind.JavaScript,
withStdlibCommon = true, jdk = TestJdkKind.FULL_JDK, configureModule = { module, platform -> withStdlibCommon = true, jdk = TestJdkKind.FULL_JDK,
if (platform == TargetPlatformKind.JavaScript) { configureModule = { module, platform ->
module.addLibrary(ForTestCompileRuntime.stdlibJsForTests(), kind = JSLibraryKind) if (platform == TargetPlatformKind.JavaScript) {
module.addLibrary(ForTestCompileRuntime.stdlibCommonForTests()) module.addLibrary(ForTestCompileRuntime.stdlibJsForTests(), kind = JSLibraryKind)
} module.addLibrary(ForTestCompileRuntime.stdlibCommonForTests())
}) }
})
} }
fun testHeaderClassImplTypealias() { fun testHeaderClassImplTypealias() {