Represent class instance initialization "as from resolve".

This commit is contained in:
Dmitry Petrov
2016-09-01 18:32:07 +03:00
committed by Dmitry Petrov
parent c3c758c7cc
commit 1b5dd50359
43 changed files with 322 additions and 164 deletions
@@ -16,6 +16,7 @@ FILE /arrayAugmentedAssignment1.kt
BLOCK_BODY
SET_BACKING_FIELD x type=kotlin.Unit operator=null
GET_VAR x type=kotlin.IntArray operator=INITIALIZE_PROPERTY_FROM_PARAMETER
INSTANCE_INITIALIZER_CALL classDescriptor=C
PROPERTY public final val x: kotlin.IntArray
EXPRESSION_BODY
GET_VAR x type=kotlin.IntArray operator=INITIALIZE_PROPERTY_FROM_PARAMETER
@@ -4,6 +4,7 @@ FILE /assignments.kt
BLOCK_BODY
SET_BACKING_FIELD x type=kotlin.Unit operator=null
GET_VAR x type=kotlin.Int operator=INITIALIZE_PROPERTY_FROM_PARAMETER
INSTANCE_INITIALIZER_CALL classDescriptor=Ref
PROPERTY public final var x: kotlin.Int
EXPRESSION_BODY
GET_VAR x type=kotlin.Int operator=INITIALIZE_PROPERTY_FROM_PARAMETER
@@ -2,6 +2,7 @@ FILE /augmentedAssignment2.kt
CLASS CLASS A
CONSTRUCTOR public constructor A()
BLOCK_BODY
INSTANCE_INITIALIZER_CALL classDescriptor=A
FUN public operator fun A.plusAssign(/*0*/ s: kotlin.String): kotlin.Unit
BLOCK_BODY
FUN public operator fun A.minusAssign(/*0*/ s: kotlin.String): kotlin.Unit
@@ -2,6 +2,7 @@ FILE /chainOfSafeCalls.kt
CLASS CLASS C
CONSTRUCTOR public constructor C()
BLOCK_BODY
INSTANCE_INITIALIZER_CALL classDescriptor=C
FUN public final fun foo(): C
BLOCK_BODY
RETURN type=kotlin.Nothing from=foo
@@ -2,11 +2,13 @@ FILE /forWithImplicitReceivers.kt
CLASS OBJECT FiveTimes
CONSTRUCTOR private constructor FiveTimes()
BLOCK_BODY
INSTANCE_INITIALIZER_CALL classDescriptor=FiveTimes
CLASS CLASS IntCell
CONSTRUCTOR public constructor IntCell(/*0*/ value: kotlin.Int)
BLOCK_BODY
SET_BACKING_FIELD value type=kotlin.Unit operator=null
GET_VAR value type=kotlin.Int operator=INITIALIZE_PROPERTY_FROM_PARAMETER
INSTANCE_INITIALIZER_CALL classDescriptor=IntCell
PROPERTY public final var value: kotlin.Int
EXPRESSION_BODY
GET_VAR value type=kotlin.Int operator=INITIALIZE_PROPERTY_FROM_PARAMETER
@@ -23,19 +23,7 @@ FILE /jvmStaticFieldReference.kt
CLASS CLASS TestClass
CONSTRUCTOR public constructor TestClass()
BLOCK_BODY
SET_BACKING_FIELD test type=kotlin.Unit operator=null
WHEN type=kotlin.Int operator=WHEN
else: BLOCK type=kotlin.Int operator=null
CALL .println type=kotlin.Unit operator=null
$this: TYPE_OP operator=IMPLICIT_NOTNULL typeOperand=java.io.PrintStream
CALL .<get-out> type=java.io.PrintStream! operator=GET_PROPERTY
p0: CONST String type=kotlin.String value='TestClass/test'
CONST Int type=kotlin.Int value='42'
BLOCK type=kotlin.Unit operator=null
CALL .println type=kotlin.Unit operator=null
$this: TYPE_OP operator=IMPLICIT_NOTNULL typeOperand=java.io.PrintStream
CALL .<get-out> type=java.io.PrintStream! operator=GET_PROPERTY
p0: CONST String type=kotlin.String value='TestClass/init'
INSTANCE_INITIALIZER_CALL classDescriptor=TestClass
PROPERTY public final val test: kotlin.Int
EXPRESSION_BODY
WHEN type=kotlin.Int operator=WHEN
@@ -45,3 +33,9 @@ FILE /jvmStaticFieldReference.kt
CALL .<get-out> type=java.io.PrintStream! operator=GET_PROPERTY
p0: CONST String type=kotlin.String value='TestClass/test'
CONST Int type=kotlin.Int value='42'
ANONYMOUS_INITIALIZER TestClass
BLOCK_BODY
CALL .println type=kotlin.Unit operator=null
$this: TYPE_OP operator=IMPLICIT_NOTNULL typeOperand=java.io.PrintStream
CALL .<get-out> type=java.io.PrintStream! operator=GET_PROPERTY
p0: CONST String type=kotlin.String value='TestClass/init'
@@ -2,6 +2,7 @@ FILE /safeCallWithIncrementDecrement.kt
CLASS CLASS C
CONSTRUCTOR public constructor C()
BLOCK_BODY
INSTANCE_INITIALIZER_CALL classDescriptor=C
PROPERTY public var test.C?.p: kotlin.Int
PROPERTY_GETTER public fun test.C?.<get-p>(): kotlin.Int
BLOCK_BODY
+1
View File
@@ -4,6 +4,7 @@ FILE /safeCalls.kt
BLOCK_BODY
SET_BACKING_FIELD value type=kotlin.Unit operator=null
GET_VAR value type=kotlin.Int operator=INITIALIZE_PROPERTY_FROM_PARAMETER
INSTANCE_INITIALIZER_CALL classDescriptor=Ref
PROPERTY public final var value: kotlin.Int
EXPRESSION_BODY
GET_VAR value type=kotlin.Int operator=INITIALIZE_PROPERTY_FROM_PARAMETER
+4
View File
@@ -3,6 +3,7 @@ FILE /values.kt
CONSTRUCTOR private constructor Enum()
BLOCK_BODY
ENUM_CONSTRUCTOR_CALL Enum super
INSTANCE_INITIALIZER_CALL classDescriptor=Enum
ENUM_ENTRY enum entry A
init: ENUM_CONSTRUCTOR_CALL Enum A
FUN public final /*synthesized*/ fun values(): kotlin.Array<Enum>
@@ -12,15 +13,18 @@ FILE /values.kt
CLASS OBJECT A
CONSTRUCTOR private constructor A()
BLOCK_BODY
INSTANCE_INITIALIZER_CALL classDescriptor=A
PROPERTY public val a: kotlin.Int = 0
EXPRESSION_BODY
CONST Int type=kotlin.Int value='0'
CLASS CLASS Z
CONSTRUCTOR public constructor Z()
BLOCK_BODY
INSTANCE_INITIALIZER_CALL classDescriptor=Z
CLASS OBJECT Companion
CONSTRUCTOR private constructor Companion()
BLOCK_BODY
INSTANCE_INITIALIZER_CALL classDescriptor=Companion
FUN public fun test1(): Enum
BLOCK_BODY
RETURN type=kotlin.Nothing from=test1
+1
View File
@@ -2,6 +2,7 @@ FILE /when.kt
CLASS OBJECT A
CONSTRUCTOR private constructor A()
BLOCK_BODY
INSTANCE_INITIALIZER_CALL classDescriptor=A
FUN public fun testWithSubject(/*0*/ x: kotlin.Any?): kotlin.String
BLOCK_BODY
RETURN type=kotlin.Nothing from=testWithSubject