Fix for KT-9958: NoSuchMethodError when we call protected method from companion object
#KT-9958 Fixed
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
package a
|
||||
|
||||
import b.*
|
||||
|
||||
class B {
|
||||
companion object : A() {}
|
||||
|
||||
init {
|
||||
foo()
|
||||
}
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
B()
|
||||
return result
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
package b
|
||||
|
||||
var result = "fail"
|
||||
|
||||
abstract class A {
|
||||
protected fun foo() {
|
||||
result = "OK"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package a
|
||||
|
||||
import b.*
|
||||
|
||||
interface B {
|
||||
companion object : A() {}
|
||||
|
||||
fun test() {
|
||||
foo()
|
||||
}
|
||||
}
|
||||
|
||||
class C : B
|
||||
|
||||
fun box(): String {
|
||||
C().test()
|
||||
return result
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
package b
|
||||
|
||||
var result = "fail"
|
||||
|
||||
abstract class A {
|
||||
protected fun foo() {
|
||||
result = "OK"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user