[Common IR] Do not add internal methods to overrides
[JS IR] Use a module name in JsFunctionSignature for internal methods ^KT-60635 Fixed
This commit is contained in:
committed by
Space Team
parent
788fa5d545
commit
7a31167e0b
@@ -0,0 +1,30 @@
|
||||
// MODULE: lib1
|
||||
|
||||
// FILE: DemoClassInternal1.kt
|
||||
abstract class DemoClassInternal {
|
||||
@PublishedApi
|
||||
internal open fun demo(): Int = 1
|
||||
}
|
||||
|
||||
// MODULE: main(lib1)
|
||||
|
||||
// FILE: MyDemo.kt
|
||||
open class MyDemo1 : DemoClassInternal()
|
||||
|
||||
class MyDemo2 : MyDemo1()
|
||||
|
||||
class MyDemo3 : DemoClassInternal() {
|
||||
<!CANNOT_OVERRIDE_INVISIBLE_MEMBER!>override<!> fun demo(): Int = 2
|
||||
}
|
||||
|
||||
class MyDemo4 : DemoClassInternal() {
|
||||
fun demo(): Int {
|
||||
return super.<!INVISIBLE_REFERENCE!>demo<!>()
|
||||
}
|
||||
}
|
||||
|
||||
// FILE: Test.kt
|
||||
fun test() {
|
||||
MyDemo1().<!INVISIBLE_REFERENCE!>demo<!>()
|
||||
MyDemo2().<!INVISIBLE_REFERENCE!>demo<!>()
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
// MODULE: lib1
|
||||
|
||||
// FILE: DemoClassInternal1.kt
|
||||
abstract class DemoClassInternal {
|
||||
@PublishedApi
|
||||
internal open fun demo(): Int = 1
|
||||
}
|
||||
|
||||
// MODULE: main(lib1)
|
||||
|
||||
// FILE: MyDemo.kt
|
||||
open class MyDemo1 : DemoClassInternal()
|
||||
|
||||
class MyDemo2 : MyDemo1()
|
||||
|
||||
class MyDemo3 : DemoClassInternal() {
|
||||
<!CANNOT_OVERRIDE_INVISIBLE_MEMBER!>override<!> fun demo(): Int = 2
|
||||
}
|
||||
|
||||
class MyDemo4 : DemoClassInternal() {
|
||||
fun demo(): Int {
|
||||
return super.<!INVISIBLE_MEMBER!>demo<!>()
|
||||
}
|
||||
}
|
||||
|
||||
// FILE: Test.kt
|
||||
fun test() {
|
||||
MyDemo1().<!INVISIBLE_MEMBER!>demo<!>()
|
||||
MyDemo2().<!INVISIBLE_MEMBER!>demo<!>()
|
||||
}
|
||||
Reference in New Issue
Block a user