Files
kotlin-fork/compiler/testData/diagnostics/tests/publishedApiOverride.kt
T
Alexander Korepanov 7a31167e0b [Common IR] Do not add internal methods to overrides
[JS IR] Use a module name in JsFunctionSignature for internal methods

^KT-60635 Fixed
2023-08-09 16:35:59 +00:00

31 lines
606 B
Kotlin
Vendored

// 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<!>()
}