Constructors represented "as in Java".

TODO: extract nested initializers somehow.
This commit is contained in:
Dmitry Petrov
2016-08-29 16:41:10 +03:00
committed by Dmitry Petrov
parent 57c1b3e0e2
commit 8528c23194
51 changed files with 1068 additions and 408 deletions
@@ -14,7 +14,8 @@ FILE /arrayAugmentedAssignment1.kt
CLASS CLASS C
FUN public constructor C(/*0*/ x: kotlin.IntArray)
BLOCK_BODY
INITIALIZE_PROPERTY x
SET_BACKING_FIELD x type=kotlin.Unit operator=null
GET_VAR x type=kotlin.IntArray operator=INITIALIZE_PROPERTY_FROM_PARAMETER
PROPERTY public final val x: kotlin.IntArray getter=null setter=null
EXPRESSION_BODY
GET_VAR x type=kotlin.IntArray operator=INITIALIZE_PROPERTY_FROM_PARAMETER
+2 -1
View File
@@ -2,7 +2,8 @@ FILE /assignments.kt
CLASS CLASS Ref
FUN public constructor Ref(/*0*/ x: kotlin.Int)
BLOCK_BODY
INITIALIZE_PROPERTY x
SET_BACKING_FIELD x type=kotlin.Unit operator=null
GET_VAR x type=kotlin.Int operator=INITIALIZE_PROPERTY_FROM_PARAMETER
PROPERTY public final var x: kotlin.Int getter=null setter=null
EXPRESSION_BODY
GET_VAR x type=kotlin.Int operator=INITIALIZE_PROPERTY_FROM_PARAMETER
@@ -1,5 +1,7 @@
FILE /augmentedAssignment2.kt
CLASS CLASS A
FUN public constructor A()
BLOCK_BODY
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
@@ -1,5 +1,7 @@
FILE /chainOfSafeCalls.kt
CLASS CLASS C
FUN public constructor C()
BLOCK_BODY
FUN public final fun foo(): C
BLOCK_BODY
RETURN type=kotlin.Nothing from=foo
+9
View File
@@ -0,0 +1,9 @@
var testSimple: Int = 0
set(value) {
field = value
}
var testAugmented: Int = 0
set(value) {
field += value
}
+17
View File
@@ -0,0 +1,17 @@
FILE /field.kt
PROPERTY public var testSimple: kotlin.Int getter=null setter=<set-testSimple>
EXPRESSION_BODY
CONST Int type=kotlin.Int value='0'
PROPERTY_SETTER public fun <set-testSimple>(/*0*/ value: kotlin.Int): kotlin.Unit property=testSimple
BLOCK_BODY
SET_BACKING_FIELD testSimple type=kotlin.Unit operator=EQ
GET_VAR value type=kotlin.Int operator=null
PROPERTY public var testAugmented: kotlin.Int getter=null setter=<set-testAugmented>
EXPRESSION_BODY
CONST Int type=kotlin.Int value='0'
PROPERTY_SETTER public fun <set-testAugmented>(/*0*/ value: kotlin.Int): kotlin.Unit property=testAugmented
BLOCK_BODY
SET_BACKING_FIELD testAugmented type=kotlin.Unit operator=PLUSEQ
CALL .plus type=kotlin.Int operator=PLUSEQ
$this: GET_BACKING_FIELD testAugmented type=kotlin.Int operator=PLUSEQ
other: GET_VAR value type=kotlin.Int operator=null
@@ -1,9 +1,12 @@
FILE /forWithImplicitReceivers.kt
CLASS OBJECT FiveTimes
FUN private constructor FiveTimes()
BLOCK_BODY
CLASS CLASS IntCell
FUN public constructor IntCell(/*0*/ value: kotlin.Int)
BLOCK_BODY
INITIALIZE_PROPERTY value
SET_BACKING_FIELD value type=kotlin.Unit operator=null
GET_VAR value type=kotlin.Int operator=INITIALIZE_PROPERTY_FROM_PARAMETER
PROPERTY public final var value: kotlin.Int getter=null setter=null
EXPRESSION_BODY
GET_VAR value type=kotlin.Int operator=INITIALIZE_PROPERTY_FROM_PARAMETER
@@ -1,5 +1,7 @@
FILE /safeCallWithIncrementDecrement.kt
CLASS CLASS C
FUN public constructor C()
BLOCK_BODY
PROPERTY public var test.C?.p: kotlin.Int getter=<get-p> setter=<set-p>
PROPERTY_GETTER public fun test.C?.<get-p>(): kotlin.Int property=p
BLOCK_BODY
+2 -1
View File
@@ -2,7 +2,8 @@ FILE /safeCalls.kt
CLASS CLASS Ref
FUN public constructor Ref(/*0*/ value: kotlin.Int)
BLOCK_BODY
INITIALIZE_PROPERTY value
SET_BACKING_FIELD value type=kotlin.Unit operator=null
GET_VAR value type=kotlin.Int operator=INITIALIZE_PROPERTY_FROM_PARAMETER
PROPERTY public final var value: kotlin.Int getter=null setter=null
EXPRESSION_BODY
GET_VAR value type=kotlin.Int operator=INITIALIZE_PROPERTY_FROM_PARAMETER
+10
View File
@@ -1,12 +1,22 @@
FILE /values.kt
CLASS ENUM_CLASS Enum
FUN private constructor Enum()
BLOCK_BODY
CLASS ENUM_ENTRY A
FUN private constructor A()
BLOCK_BODY
CLASS OBJECT A
FUN private constructor A()
BLOCK_BODY
PROPERTY public val a: kotlin.Int = 0 getter=null setter=null
EXPRESSION_BODY
CONST Int type=kotlin.Int value='0'
CLASS CLASS Z
FUN public constructor Z()
BLOCK_BODY
CLASS OBJECT Companion
FUN private constructor Companion()
BLOCK_BODY
FUN public fun test1(): Enum
BLOCK_BODY
RETURN type=kotlin.Nothing from=test1
+2
View File
@@ -1,5 +1,7 @@
FILE /when.kt
CLASS OBJECT A
FUN private constructor A()
BLOCK_BODY
FUN public fun testWithSubject(/*0*/ x: kotlin.Any?): kotlin.String
BLOCK_BODY
RETURN type=kotlin.Nothing from=testWithSubject