Some more tests.

This commit is contained in:
Dmitry Petrov
2016-09-02 14:24:24 +03:00
committed by Dmitry Petrov
parent 42988383e0
commit f2e778d2d0
7 changed files with 125 additions and 0 deletions
@@ -0,0 +1,9 @@
abstract class Base
object Test : Base() {
val x = 1
val y: Int
init {
y = x
}
}
@@ -0,0 +1,19 @@
FILE /objectWithInitializers.kt
CLASS CLASS Base
CONSTRUCTOR public constructor Base()
BLOCK_BODY
INSTANCE_INITIALIZER_CALL classDescriptor=Base
CLASS OBJECT Test
CONSTRUCTOR private constructor Test()
BLOCK_BODY
CALL .<init> type=Base operator=SUPER_CONSTRUCTOR_CALL
INSTANCE_INITIALIZER_CALL classDescriptor=Test
PROPERTY public final val x: kotlin.Int = 1
EXPRESSION_BODY
CONST Int type=kotlin.Int value='1'
PROPERTY public final val y: kotlin.Int
ANONYMOUS_INITIALIZER Test
BLOCK_BODY
SET_BACKING_FIELD y type=kotlin.Unit operator=null
CALL .<get-x> type=kotlin.Int operator=GET_PROPERTY
$this: THIS public object Test : Base type=Test
+5
View File
@@ -0,0 +1,5 @@
sealed class Expr {
class Const(val number: Double) : Expr()
class Sum(val e1: Expr, val e2: Expr) : Expr()
object NotANumber : Expr()
}
+35
View File
@@ -0,0 +1,35 @@
FILE /sealedClasses.kt
CLASS CLASS Expr
CONSTRUCTOR private constructor Expr()
BLOCK_BODY
INSTANCE_INITIALIZER_CALL classDescriptor=Expr
CLASS CLASS Const
CONSTRUCTOR public constructor Const(/*0*/ number: kotlin.Double)
BLOCK_BODY
CALL .<init> type=Expr operator=SUPER_CONSTRUCTOR_CALL
SET_BACKING_FIELD number type=kotlin.Unit operator=null
GET_VAR number type=kotlin.Double operator=INITIALIZE_PROPERTY_FROM_PARAMETER
INSTANCE_INITIALIZER_CALL classDescriptor=Const
PROPERTY public final val number: kotlin.Double
EXPRESSION_BODY
GET_VAR number type=kotlin.Double operator=INITIALIZE_PROPERTY_FROM_PARAMETER
CLASS CLASS Sum
CONSTRUCTOR public constructor Sum(/*0*/ e1: Expr, /*1*/ e2: Expr)
BLOCK_BODY
CALL .<init> type=Expr operator=SUPER_CONSTRUCTOR_CALL
SET_BACKING_FIELD e1 type=kotlin.Unit operator=null
GET_VAR e1 type=Expr operator=INITIALIZE_PROPERTY_FROM_PARAMETER
SET_BACKING_FIELD e2 type=kotlin.Unit operator=null
GET_VAR e2 type=Expr operator=INITIALIZE_PROPERTY_FROM_PARAMETER
INSTANCE_INITIALIZER_CALL classDescriptor=Sum
PROPERTY public final val e1: Expr
EXPRESSION_BODY
GET_VAR e1 type=Expr operator=INITIALIZE_PROPERTY_FROM_PARAMETER
PROPERTY public final val e2: Expr
EXPRESSION_BODY
GET_VAR e2 type=Expr operator=INITIALIZE_PROPERTY_FROM_PARAMETER
CLASS OBJECT NotANumber
CONSTRUCTOR private constructor NotANumber()
BLOCK_BODY
CALL .<init> type=Expr operator=SUPER_CONSTRUCTOR_CALL
INSTANCE_INITIALIZER_CALL classDescriptor=NotANumber