mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-11 00:21:29 +00:00
JVM: add tests for companion object accessor generation
This commit is contained in:
22
compiler/testData/codegen/bytecodeText/companion/protectedCompanionObjectAccessors_after.kt
vendored
Normal file
22
compiler/testData/codegen/bytecodeText/companion/protectedCompanionObjectAccessors_after.kt
vendored
Normal file
@@ -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\$
|
||||
20
compiler/testData/codegen/bytecodeText/companion/protectedCompanionObjectAccessors_before.kt
vendored
Normal file
20
compiler/testData/codegen/bytecodeText/companion/protectedCompanionObjectAccessors_before.kt
vendored
Normal file
@@ -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