JVM: add tests for companion object accessor generation
This commit is contained in:
Vendored
+22
@@ -0,0 +1,22 @@
|
||||
// !LANGUAGE: +ProperVisibilityForCompanionObjectInstanceField
|
||||
// IGNORE_BACKEND: JVM_IR
|
||||
// ^ TODO implement ProperVisibilityForCompanionObjectInstanceField feature support in JMV_IR
|
||||
|
||||
// FILE: Base.kt
|
||||
package a
|
||||
|
||||
open class Base {
|
||||
protected companion object {
|
||||
fun foo() = 1
|
||||
}
|
||||
}
|
||||
|
||||
// FILE: Host.kt
|
||||
import a.*
|
||||
|
||||
class Host : Base() {
|
||||
fun test() = { foo() }
|
||||
}
|
||||
|
||||
// @Host.class:
|
||||
// 1 synthetic access\$
|
||||
Vendored
+20
@@ -0,0 +1,20 @@
|
||||
// !LANGUAGE: -ProperVisibilityForCompanionObjectInstanceField
|
||||
|
||||
// FILE: Base.kt
|
||||
package a
|
||||
|
||||
open class Base {
|
||||
protected companion object {
|
||||
fun foo() = 1
|
||||
}
|
||||
}
|
||||
|
||||
// FILE: Host.kt
|
||||
import a.*
|
||||
|
||||
class Host : Base() {
|
||||
fun test() = { foo() }
|
||||
}
|
||||
|
||||
// @Host.class:
|
||||
// 0 synthetic access\$
|
||||
Reference in New Issue
Block a user