Secondary constructors in classes.
This commit is contained in:
committed by
Dmitry Petrov
parent
ac80195597
commit
225d792939
+6
-1
@@ -2,7 +2,12 @@ FILE /classMembers.kt
|
||||
CLASS CLASS C
|
||||
PROPERTY public final val y: kotlin.Int getter=null setter=null
|
||||
PROPERTY public final var z: kotlin.Int getter=null setter=null
|
||||
DUMMY ConstructorDescriptorImpl <init>
|
||||
FUN public constructor C()
|
||||
BLOCK_BODY
|
||||
CALL .<init> type=C operator=DELEGATING_CONSTRUCTOR_CALL
|
||||
x: CONST Int type=kotlin.Int value='0'
|
||||
y: CONST Int type=kotlin.Int value='0'
|
||||
z: CONST Int type=kotlin.Int value='0'
|
||||
PROPERTY public final val property: kotlin.Int = 0 getter=null setter=null
|
||||
EXPRESSION_BODY
|
||||
CONST Int type=kotlin.Int value='0'
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
class C {
|
||||
constructor() : this(0) {}
|
||||
constructor(x: Int) {}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
FILE /secondaryConstructors.kt
|
||||
CLASS CLASS C
|
||||
FUN public constructor C()
|
||||
BLOCK_BODY
|
||||
CALL .<init> type=C operator=DELEGATING_CONSTRUCTOR_CALL
|
||||
x: CONST Int type=kotlin.Int value='0'
|
||||
FUN public constructor C(/*0*/ x: kotlin.Int)
|
||||
BLOCK_BODY
|
||||
CALL .<init> type=kotlin.Any operator=DELEGATING_CONSTRUCTOR_CALL
|
||||
Reference in New Issue
Block a user