Fixed bug in InlineCopyIr with IrGetClass + test
This commit is contained in:
-1
@@ -597,7 +597,6 @@ internal class DeepCopyIrTreeWithDescriptors(val targetDescriptor: FunctionDescr
|
|||||||
|
|
||||||
override fun visitGetClass(expression: IrGetClass): IrGetClass {
|
override fun visitGetClass(expression: IrGetClass): IrGetClass {
|
||||||
val type = substituteType(expression.type)!!
|
val type = substituteType(expression.type)!!
|
||||||
if (type == expression.type) return expression
|
|
||||||
return IrGetClassImpl(
|
return IrGetClassImpl(
|
||||||
startOffset = expression.startOffset,
|
startOffset = expression.startOffset,
|
||||||
endOffset = expression.endOffset,
|
endOffset = expression.endOffset,
|
||||||
|
|||||||
@@ -2261,6 +2261,11 @@ task inline_lambdaAsAny(type: RunKonanTest) {
|
|||||||
source = "codegen/inline/lambdaAsAny.kt"
|
source = "codegen/inline/lambdaAsAny.kt"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
task inline_getClass(type: RunKonanTest) {
|
||||||
|
goldValue = "OK\n"
|
||||||
|
source = "codegen/inline/getClass.kt"
|
||||||
|
}
|
||||||
|
|
||||||
task deserialized_inline0(type: RunKonanTest) {
|
task deserialized_inline0(type: RunKonanTest) {
|
||||||
source = "serialization/deserialized_inline0.kt"
|
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")
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user