[K/N][Tests] Move codegen test sources cycles..innerClass

^KT-61259
This commit is contained in:
Vladimir Sukharev
2023-12-13 23:53:55 +01:00
committed by Space Team
parent 35d2be25b2
commit 71a834b778
282 changed files with 2376 additions and 756 deletions
@@ -0,0 +1,22 @@
/*
* Copyright 2010-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license
* that can be found in the LICENSE file.
*/
interface I {
fun foo()
}
fun test() {
val impl = object : I {
override fun foo() { println("zzz") }
}
val delegating = object: I by impl { }
delegating.foo()
}
fun main() {
test()
}
@@ -0,0 +1 @@
zzz
@@ -0,0 +1,5 @@
class Foo(val box: String = "box")
fun main() {
println(Foo().box)
}
@@ -0,0 +1,13 @@
interface Base { val id: Int }
inline class Child(override val id: Int = 1) : Base
interface Base2 { val prop: Base }
class Child2(override val prop: Child) : Base2
fun main() {
val x : Base = Child(5)
println(x.id)
val y : Base2 = Child2(Child(5))
println(y.prop)
}
@@ -0,0 +1,2 @@
5
Child(id=5)
@@ -0,0 +1,14 @@
interface I {
fun foo(): Int
}
class A : I {
override fun foo() = 42
}
fun main(args: Array<String>) {
lateinit var a: I
if (args.size == 0)
a = A()
println(a.foo())
}
@@ -0,0 +1 @@
42