Basic class members generation.
Split testData into 'classes' and 'expressions'.
This commit is contained in:
committed by
Dmitry Petrov
parent
703d3405ed
commit
0b647ac358
@@ -134,7 +134,7 @@ class RenderIrElementVisitor : IrElementVisitor<String, Nothing?> {
|
||||
"TRY_CATCH type=${tryCatch.renderType()}"
|
||||
|
||||
override fun visitDummyDeclaration(declaration: IrDummyDeclaration, data: Nothing?): String =
|
||||
"DUMMY ${declaration.descriptor.name}"
|
||||
"DUMMY ${declaration.descriptor.javaClass.simpleName} ${declaration.descriptor.name}"
|
||||
|
||||
override fun visitDummyExpression(expression: IrDummyExpression, data: Nothing?): String =
|
||||
"DUMMY ${expression.description} type=${expression.renderType()}"
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
class C(x: Int, val y: Int, var z: Int = 1) {
|
||||
constructor() : this(0, 0, 0) {}
|
||||
|
||||
val property: Int = 0
|
||||
|
||||
val propertyWithGet: Int
|
||||
get() = 42
|
||||
|
||||
var propertyWithGetAndSet: Int
|
||||
get() = z
|
||||
set(value) {
|
||||
z = value
|
||||
}
|
||||
|
||||
fun function() {
|
||||
println("1")
|
||||
}
|
||||
|
||||
fun Int.memberExtensionFunction() {
|
||||
println("2")
|
||||
}
|
||||
|
||||
class NestedClass {
|
||||
fun function() {
|
||||
println("3")
|
||||
}
|
||||
|
||||
fun Int.memberExtensionFunction() {
|
||||
println("4")
|
||||
}
|
||||
}
|
||||
|
||||
interface NestedInterface {
|
||||
fun foo()
|
||||
fun bar() = foo()
|
||||
}
|
||||
|
||||
companion object
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
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>
|
||||
PROPERTY public final val property: kotlin.Int = 0 getter=null setter=null
|
||||
EXPRESSION_BODY
|
||||
CONST Int type=kotlin.Int value='0'
|
||||
PROPERTY public final val propertyWithGet: kotlin.Int getter=<get-propertyWithGet> setter=null
|
||||
PROPERTY_GETTER public final fun <get-propertyWithGet>(): kotlin.Int property=propertyWithGet
|
||||
BLOCK_BODY
|
||||
RETURN type=kotlin.Nothing
|
||||
CONST Int type=kotlin.Int value='42'
|
||||
PROPERTY public final var propertyWithGetAndSet: kotlin.Int getter=<get-propertyWithGetAndSet> setter=<set-propertyWithGetAndSet>
|
||||
PROPERTY_GETTER public final fun <get-propertyWithGetAndSet>(): kotlin.Int property=propertyWithGetAndSet
|
||||
BLOCK_BODY
|
||||
RETURN type=kotlin.Nothing
|
||||
CALL .<get-z> type=kotlin.Int operator=GET_PROPERTY
|
||||
$this: THIS public final class C type=C
|
||||
PROPERTY_SETTER public final fun <set-propertyWithGetAndSet>(/*0*/ value: kotlin.Int): kotlin.Unit property=propertyWithGetAndSet
|
||||
BLOCK_BODY
|
||||
CALL .<set-z> type=kotlin.Unit operator=EQ
|
||||
$this: THIS public final class C type=C
|
||||
<set-?>: GET_VAR value type=kotlin.Int operator=null
|
||||
FUN public final fun function(): kotlin.Unit
|
||||
BLOCK_BODY
|
||||
CALL .println type=kotlin.Unit operator=null
|
||||
message: CONST String type=kotlin.String value='1'
|
||||
FUN public final fun kotlin.Int.memberExtensionFunction(): kotlin.Unit
|
||||
BLOCK_BODY
|
||||
CALL .println type=kotlin.Unit operator=null
|
||||
message: CONST String type=kotlin.String value='2'
|
||||
CLASS CLASS NestedClass
|
||||
FUN public final fun function(): kotlin.Unit
|
||||
BLOCK_BODY
|
||||
CALL .println type=kotlin.Unit operator=null
|
||||
message: CONST String type=kotlin.String value='3'
|
||||
FUN public final fun kotlin.Int.memberExtensionFunction(): kotlin.Unit
|
||||
BLOCK_BODY
|
||||
CALL .println type=kotlin.Unit operator=null
|
||||
message: CONST String type=kotlin.String value='4'
|
||||
CLASS INTERFACE NestedInterface
|
||||
FUN public abstract fun foo(): kotlin.Unit
|
||||
FUN public open fun bar(): kotlin.Unit
|
||||
BLOCK_BODY
|
||||
RETURN type=kotlin.Nothing
|
||||
CALL .foo type=kotlin.Unit operator=null
|
||||
$this: THIS public interface NestedInterface type=C.NestedInterface
|
||||
CLASS OBJECT Companion
|
||||
Vendored
Vendored
Vendored
Vendored
Vendored
Vendored
Vendored
Vendored
Vendored
Vendored
Vendored
Vendored
Vendored
Vendored
Vendored
Vendored
Vendored
Vendored
Vendored
Vendored
Vendored
Vendored
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user