[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
+11
@@ -0,0 +1,11 @@
|
||||
package foo
|
||||
|
||||
internal expect abstract class ExpectBase() {
|
||||
abstract fun foo(cause: Throwable?)
|
||||
}
|
||||
|
||||
interface I {
|
||||
fun foo(cause: Throwable?)
|
||||
}
|
||||
|
||||
internal abstract class CommonAbstract : ExpectBase()
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
package foo
|
||||
|
||||
private class A : CommonAbstract() {
|
||||
override fun foo(cause: Throwable?) {}
|
||||
}
|
||||
|
||||
internal actual abstract class ExpectBase actual constructor() : I {
|
||||
actual abstract override fun foo(cause: Throwable?)
|
||||
}
|
||||
Reference in New Issue
Block a user