Fixed bug in InlineCopyIr with IrGetClass + test

This commit is contained in:
Igor Chevdar
2018-03-23 13:50:44 +03:00
parent 3645c22f8d
commit 183bf917ee
3 changed files with 23 additions and 1 deletions
@@ -597,7 +597,6 @@ internal class DeepCopyIrTreeWithDescriptors(val targetDescriptor: FunctionDescr
override fun visitGetClass(expression: IrGetClass): IrGetClass {
val type = substituteType(expression.type)!!
if (type == expression.type) return expression
return IrGetClassImpl(
startOffset = expression.startOffset,
endOffset = expression.endOffset,
+5
View File
@@ -2261,6 +2261,11 @@ task inline_lambdaAsAny(type: RunKonanTest) {
source = "codegen/inline/lambdaAsAny.kt"
}
task inline_getClass(type: RunKonanTest) {
goldValue = "OK\n"
source = "codegen/inline/getClass.kt"
}
task deserialized_inline0(type: RunKonanTest) {
source = "serialization/deserialized_inline0.kt"
}
@@ -0,0 +1,18 @@
package codegen.inline.getClass
import kotlin.test.*
fun foo() {
val cls1: Any? = Int
val cls2: Any? = null
cls1?.let {
cls2?.let {
var itClass = it::class
}
}
}
@Test fun runTest() {
println("OK")
}