mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-09 00:21:47 +00:00
AbstractCompileKotlinAgainstMultifileKotlinTest is broken in this commit; will be fixed later
39 lines
506 B
Kotlin
Vendored
39 lines
506 B
Kotlin
Vendored
// FILE: 1.kt
|
|
|
|
import b.B
|
|
import a.BSamePackage
|
|
|
|
fun box() = if (B().test() == BSamePackage().test()) "OK" else "fail"
|
|
|
|
// FILE: 2.kt
|
|
|
|
package a
|
|
|
|
open class A {
|
|
protected fun protectedFun(): String = "OK"
|
|
}
|
|
|
|
class BSamePackage: A() {
|
|
fun test(): String {
|
|
val a = {
|
|
protectedFun()
|
|
}
|
|
return a()
|
|
}
|
|
}
|
|
|
|
// FILE: 3.kt
|
|
|
|
package b
|
|
|
|
import a.A
|
|
|
|
class B: A() {
|
|
fun test(): String {
|
|
val a = {
|
|
protectedFun()
|
|
}
|
|
return a()
|
|
}
|
|
}
|