Inner classes lowering.

This commit is contained in:
Dmitry Petrov
2016-10-18 15:59:33 +03:00
parent f933cf5395
commit 7dce1f438f
16 changed files with 380 additions and 31 deletions
@@ -0,0 +1,8 @@
class Outer {
val x = "O"
inner class Inner {
val y = x + "K"
}
}
fun box() = Outer().Inner().y
@@ -0,0 +1,5 @@
class Outer {
inner class Inner(val x: Int) {
constructor() : this(0)
}
}
@@ -0,0 +1,25 @@
FILE /innerClassWithDelegatingConstructor.kt
CLASS CLASS Outer
CONSTRUCTOR public constructor Outer()
BLOCK_BODY
DELEGATING_CONSTRUCTOR_CALL 'constructor Any()'
INSTANCE_INITIALIZER_CALL classDescriptor='Outer'
CLASS CLASS Inner
CONSTRUCTOR public constructor Inner(x: kotlin.Int)
BLOCK_BODY
DELEGATING_CONSTRUCTOR_CALL 'constructor Any()'
INSTANCE_INITIALIZER_CALL classDescriptor='Inner'
PROPERTY public final val x: kotlin.Int
FIELD PROPERTY_BACKING_FIELD public final val x: kotlin.Int
EXPRESSION_BODY
GET_VAR 'value-parameter x: Int' type=kotlin.Int origin=INITIALIZE_PROPERTY_FROM_PARAMETER
FUN DEFAULT_PROPERTY_ACCESSOR public final fun <get-x>(): kotlin.Int
BLOCK_BODY
RETURN type=kotlin.Nothing from='<get-x>(): Int'
GET_FIELD 'x: Int' type=kotlin.Int origin=null
receiver: GET_VAR '<receiver: Inner>' type=Outer.Inner origin=null
CONSTRUCTOR public constructor Inner()
BLOCK_BODY
DELEGATING_CONSTRUCTOR_CALL 'constructor Inner(Int)'
$this: GET_VAR '<receiver: Outer>' type=Outer origin=null
x: CONST Int type=kotlin.Int value='0'