[Invariant fix] Fix false positive internal visibility diagnostic
Effectively, this commit allows for common module to see internal content of all expect-modules The problem is that when computing the member scope for A (see the test) we're building a special member scope for CommonAbstract viewed from JVM and it's effectively has a fake override of actual member from Jvm/ExpectBase. OverridingUtil checks if it's visible in CommonAbstract and finds that it's not thus creating a fake_invisible fake override The latter results in A::foo override being marked as INVISIBLE_MEMBER_OVERRIDE Probably, the fix might be smarter (passing a requested module to OverridingUtil::createAndBindFakeOverride) but allowing using internal member seems to be safe & simple because it's reasonable to assume there's no cyclic dependencies between expected/actual modules
This commit is contained in:
committed by
Dmitry Savvinov
parent
d20516779a
commit
d744192e6f
@@ -125,7 +125,12 @@ class ModuleDescriptorImpl @JvmOverloads constructor(
|
||||
}
|
||||
|
||||
override fun shouldSeeInternalsOf(targetModule: ModuleDescriptor): Boolean {
|
||||
return this == targetModule || targetModule in dependencies!!.modulesWhoseInternalsAreVisible || targetModule in expectedByModules
|
||||
if (this == targetModule) return true
|
||||
if (targetModule in dependencies!!.modulesWhoseInternalsAreVisible) return true
|
||||
if (targetModule in expectedByModules) return true
|
||||
if (this in targetModule.expectedByModules) return true
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
private val id: String
|
||||
|
||||
Reference in New Issue
Block a user