Fixed support for classes in inline functions
This commit is contained in:
Sergey Bogolepov
2018-08-21 11:41:09 +03:00
committed by GitHub
parent 317ca076ac
commit 8f7bcf2688
3 changed files with 46 additions and 0 deletions
+5
View File
@@ -2518,6 +2518,11 @@ task inline_defaultArgs(type: RunKonanTest) {
source = "codegen/inline/defaultArgs.kt"
}
task classDeclarationInsideInline(type: RunKonanTest) {
source = "codegen/inline/classDeclarationInsideInline.kt"
goldValue = "test1: 1.0\n1\ntest2\n"
}
task deserialized_inline0(type: RunKonanTest) {
source = "serialization/deserialized_inline0.kt"
}
@@ -0,0 +1,24 @@
package codegen.inline.classDeclarationInsideInline
import kotlin.test.*
fun f() {
run {
class Test1<T : Number, G>(val x: T, val y: G) {
override fun toString() = "test1: ${x.toDouble()}"
}
class Test2<X>(val a: Test1<Int, X>) {
override fun toString() = "test2"
}
val v = Test2(Test1(1, Test2(Test1(1, 3))))
println(v.a)
println(v.a.x)
println(v.a.y)
}
}
@Test fun test() {
f()
}