+17
@@ -229,6 +229,10 @@ internal class DeepCopyIrTreeWithDescriptors(val targetDescriptor: FunctionDescr
|
|||||||
/* storageManager = */ LockBasedStorageManager.NO_LOCKS
|
/* storageManager = */ LockBasedStorageManager.NO_LOCKS
|
||||||
) {
|
) {
|
||||||
override fun getVisibility() = visibility
|
override fun getVisibility() = visibility
|
||||||
|
|
||||||
|
override fun getDeclaredTypeParameters(): List<TypeParameterDescriptor> {
|
||||||
|
return oldDescriptor.declaredTypeParameters
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -497,6 +501,19 @@ internal class DeepCopyIrTreeWithDescriptors(val targetDescriptor: FunctionDescr
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
override fun visitField(declaration: IrField): IrField {
|
||||||
|
val descriptor = mapPropertyDeclaration(declaration.descriptor)
|
||||||
|
return IrFieldImpl(
|
||||||
|
declaration.startOffset, declaration.endOffset,
|
||||||
|
mapDeclarationOrigin(declaration.origin),
|
||||||
|
descriptor,
|
||||||
|
context.ir.translateErased(descriptor.type),
|
||||||
|
declaration.initializer?.transform(this@InlineCopyIr, null)
|
||||||
|
).apply {
|
||||||
|
transformAnnotations(declaration)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------//
|
//---------------------------------------------------------------------//
|
||||||
|
|
||||||
override fun visitSimpleFunction(declaration: IrSimpleFunction): IrFunction {
|
override fun visitSimpleFunction(declaration: IrSimpleFunction): IrFunction {
|
||||||
|
|||||||
@@ -2518,6 +2518,11 @@ task inline_defaultArgs(type: RunKonanTest) {
|
|||||||
source = "codegen/inline/defaultArgs.kt"
|
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) {
|
task deserialized_inline0(type: RunKonanTest) {
|
||||||
source = "serialization/deserialized_inline0.kt"
|
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()
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user