mirror of
https://github.com/github/codeql.git
synced 2025-12-17 01:03:14 +01:00
Merge pull request #9755 from smowton/smowton/feature/implement-jvmstatic-annotation
Kotlin: support JvmStatic annotation
This commit is contained in:
@@ -406,6 +406,8 @@ open class KotlinFileExtractor(
|
||||
extractDeclInitializers(c.declarations, false) { Pair(blockId, obinitId) }
|
||||
}
|
||||
|
||||
val jvmStaticFqName = FqName("kotlin.jvm.JvmStatic")
|
||||
|
||||
fun extractClassSource(c: IrClass, extractDeclarations: Boolean, extractStaticInitializer: Boolean, extractPrivateMembers: Boolean, extractFunctionBodies: Boolean): Label<out DbClassorinterface> {
|
||||
with("class source", c) {
|
||||
DeclarationStackAdjuster(c).use {
|
||||
@@ -442,9 +444,10 @@ open class KotlinFileExtractor(
|
||||
|
||||
c.typeParameters.mapIndexed { idx, param -> extractTypeParameter(param, idx, javaClass?.typeParameters?.getOrNull(idx)) }
|
||||
if (extractDeclarations) {
|
||||
c.declarations.map { extractDeclaration(it, extractPrivateMembers = extractPrivateMembers, extractFunctionBodies = extractFunctionBodies) }
|
||||
c.declarations.forEach { extractDeclaration(it, extractPrivateMembers = extractPrivateMembers, extractFunctionBodies = extractFunctionBodies) }
|
||||
if (extractStaticInitializer)
|
||||
extractStaticInitializer(c, id)
|
||||
extractJvmStaticProxyMethods(c, id, extractPrivateMembers, extractFunctionBodies)
|
||||
}
|
||||
if (c.isNonCompanionObject) {
|
||||
// For `object MyObject { ... }`, the .class has an
|
||||
@@ -472,6 +475,76 @@ open class KotlinFileExtractor(
|
||||
}
|
||||
}
|
||||
|
||||
private fun extractJvmStaticProxyMethods(c: IrClass, classId: Label<out DbClassorinterface>, extractPrivateMembers: Boolean, extractFunctionBodies: Boolean) {
|
||||
|
||||
// Add synthetic forwarders for any JvmStatic methods or properties:
|
||||
val companionObject = c.companionObject() ?: return
|
||||
|
||||
val cType = c.typeWith()
|
||||
val companionType = companionObject.typeWith()
|
||||
|
||||
fun makeProxyFunction(f: IrFunction) {
|
||||
// Emit a function in class `c` that delegates to the same function defined on `c.CompanionInstance`.
|
||||
val proxyFunctionId = tw.getLabelFor<DbMethod>(getFunctionLabel(f, classId, listOf()))
|
||||
// We extract the function prototype with its ID overridden to belong to `c` not the companion object,
|
||||
// but suppress outputting the body, which we will replace with a delegating call below.
|
||||
forceExtractFunction(f, classId, extractBody = false, extractMethodAndParameterTypeAccesses = extractFunctionBodies, typeSubstitution = null, classTypeArgsIncludingOuterClasses = listOf(), idOverride = proxyFunctionId, locOverride = null, extractOrigin = false)
|
||||
addModifiers(proxyFunctionId, "static")
|
||||
tw.writeCompiler_generated(proxyFunctionId, CompilerGeneratedKinds.JVMSTATIC_PROXY_METHOD.kind)
|
||||
if (extractFunctionBodies) {
|
||||
val realFunctionLocId = tw.getLocation(f)
|
||||
extractExpressionBody(proxyFunctionId, realFunctionLocId).also { returnId ->
|
||||
extractRawMethodAccess(
|
||||
f,
|
||||
realFunctionLocId,
|
||||
f.returnType,
|
||||
proxyFunctionId,
|
||||
returnId,
|
||||
0,
|
||||
returnId,
|
||||
f.valueParameters.size,
|
||||
{ argParent, idxOffset ->
|
||||
f.valueParameters.forEachIndexed { idx, param ->
|
||||
val syntheticParamId = useValueParameter(param, proxyFunctionId)
|
||||
extractVariableAccess(syntheticParamId, param.type, realFunctionLocId, argParent, idxOffset + idx, proxyFunctionId, returnId)
|
||||
}
|
||||
},
|
||||
companionType,
|
||||
{ callId ->
|
||||
val companionField = useCompanionObjectClassInstance(companionObject)?.id
|
||||
extractVariableAccess(companionField, companionType, realFunctionLocId, callId, -1, proxyFunctionId, returnId).also { varAccessId ->
|
||||
extractTypeAccessRecursive(cType, realFunctionLocId, varAccessId, -1, proxyFunctionId, returnId)
|
||||
}
|
||||
},
|
||||
null
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
companionObject.declarations.forEach {
|
||||
if (shouldExtractDecl(it, extractPrivateMembers)) {
|
||||
val wholeDeclAnnotated = it.hasAnnotation(jvmStaticFqName)
|
||||
when(it) {
|
||||
is IrFunction -> {
|
||||
if (wholeDeclAnnotated)
|
||||
makeProxyFunction(it)
|
||||
}
|
||||
is IrProperty -> {
|
||||
it.getter?.let { getter ->
|
||||
if (wholeDeclAnnotated || getter.hasAnnotation(jvmStaticFqName))
|
||||
makeProxyFunction(getter)
|
||||
}
|
||||
it.setter?.let { setter ->
|
||||
if (wholeDeclAnnotated || setter.hasAnnotation(jvmStaticFqName))
|
||||
makeProxyFunction(setter)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// If `parentClassTypeArguments` is null, the parent class is a raw type.
|
||||
private fun extractEnclosingClass(innerDeclaration: IrDeclaration, innerId: Label<out DbClassorinterface>, innerLocId: Label<DbLocation>, parentClassTypeArguments: List<IrTypeArgument>?) {
|
||||
with("enclosing class", innerDeclaration) {
|
||||
@@ -740,7 +813,7 @@ open class KotlinFileExtractor(
|
||||
else
|
||||
forceExtractFunction(f, parentId, extractBody, extractMethodAndParameterTypeAccesses, typeSubstitution, classTypeArgsIncludingOuterClasses, null, null)
|
||||
|
||||
private fun forceExtractFunction(f: IrFunction, parentId: Label<out DbReftype>, extractBody: Boolean, extractMethodAndParameterTypeAccesses: Boolean, typeSubstitution: TypeSubstitution?, classTypeArgsIncludingOuterClasses: List<IrTypeArgument>?, idOverride: Label<DbMethod>?, locOverride: Label<DbLocation>?): Label<out DbCallable> {
|
||||
private fun forceExtractFunction(f: IrFunction, parentId: Label<out DbReftype>, extractBody: Boolean, extractMethodAndParameterTypeAccesses: Boolean, typeSubstitution: TypeSubstitution?, classTypeArgsIncludingOuterClasses: List<IrTypeArgument>?, idOverride: Label<DbMethod>?, locOverride: Label<DbLocation>?, extractOrigin: Boolean = true): Label<out DbCallable> {
|
||||
with("function", f) {
|
||||
DeclarationStackAdjuster(f).use {
|
||||
|
||||
@@ -797,13 +870,15 @@ open class KotlinFileExtractor(
|
||||
val methodId = id.cast<DbMethod>()
|
||||
tw.writeMethods(methodId, shortName.nameInDB, "${shortName.nameInDB}$paramsSignature", returnType.javaResult.id, parentId, sourceDeclaration.cast<DbMethod>())
|
||||
tw.writeMethodsKotlinType(methodId, returnType.kotlinResult.id)
|
||||
when (f.origin) {
|
||||
IrDeclarationOrigin.GENERATED_DATA_CLASS_MEMBER ->
|
||||
tw.writeCompiler_generated(methodId, CompilerGeneratedKinds.GENERATED_DATA_CLASS_MEMBER.kind)
|
||||
IrDeclarationOrigin.DEFAULT_PROPERTY_ACCESSOR ->
|
||||
tw.writeCompiler_generated(methodId, CompilerGeneratedKinds.DEFAULT_PROPERTY_ACCESSOR.kind)
|
||||
IrDeclarationOrigin.ENUM_CLASS_SPECIAL_MEMBER ->
|
||||
tw.writeCompiler_generated(methodId, CompilerGeneratedKinds.ENUM_CLASS_SPECIAL_MEMBER.kind)
|
||||
if (extractOrigin) {
|
||||
when (f.origin) {
|
||||
IrDeclarationOrigin.GENERATED_DATA_CLASS_MEMBER ->
|
||||
tw.writeCompiler_generated(methodId, CompilerGeneratedKinds.GENERATED_DATA_CLASS_MEMBER.kind)
|
||||
IrDeclarationOrigin.DEFAULT_PROPERTY_ACCESSOR ->
|
||||
tw.writeCompiler_generated(methodId, CompilerGeneratedKinds.DEFAULT_PROPERTY_ACCESSOR.kind)
|
||||
IrDeclarationOrigin.ENUM_CLASS_SPECIAL_MEMBER ->
|
||||
tw.writeCompiler_generated(methodId, CompilerGeneratedKinds.ENUM_CLASS_SPECIAL_MEMBER.kind)
|
||||
}
|
||||
}
|
||||
|
||||
if (extractMethodAndParameterTypeAccesses) {
|
||||
@@ -824,13 +899,13 @@ open class KotlinFileExtractor(
|
||||
}
|
||||
|
||||
extractVisibility(f, id, f.visibility)
|
||||
|
||||
if (f.isInline) {
|
||||
addModifiers(id, "inline")
|
||||
}
|
||||
if (isStaticFunction(f)) {
|
||||
if (f.shouldExtractAsStatic) {
|
||||
addModifiers(id, "static")
|
||||
}
|
||||
|
||||
if (f is IrSimpleFunction && f.overriddenSymbols.isNotEmpty()) {
|
||||
addModifiers(id, "override")
|
||||
}
|
||||
@@ -1028,15 +1103,21 @@ open class KotlinFileExtractor(
|
||||
|
||||
private fun extractExpressionBody(b: IrExpressionBody, callable: Label<out DbCallable>) {
|
||||
with("expression body", b) {
|
||||
val blockId = tw.getFreshIdLabel<DbBlock>()
|
||||
val locId = tw.getLocation(b)
|
||||
tw.writeStmts_block(blockId, callable, 0, callable)
|
||||
tw.writeHasLocation(blockId, locId)
|
||||
extractExpressionBody(callable, locId).also { returnId ->
|
||||
extractExpressionExpr(b.expression, callable, returnId, 0, returnId)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
val returnId = tw.getFreshIdLabel<DbReturnstmt>()
|
||||
fun extractExpressionBody(callable: Label<out DbCallable>, locId: Label<out DbLocation>): Label<out DbStmt> {
|
||||
val blockId = tw.getFreshIdLabel<DbBlock>()
|
||||
tw.writeStmts_block(blockId, callable, 0, callable)
|
||||
tw.writeHasLocation(blockId, locId)
|
||||
|
||||
return tw.getFreshIdLabel<DbReturnstmt>().also { returnId ->
|
||||
tw.writeStmts_returnstmt(returnId, blockId, 0, callable)
|
||||
tw.writeHasLocation(returnId, locId)
|
||||
extractExpressionExpr(b.expression, callable, returnId, 0, returnId)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1307,10 +1388,48 @@ open class KotlinFileExtractor(
|
||||
typeArguments: List<IrType> = listOf(),
|
||||
extractClassTypeArguments: Boolean = false) {
|
||||
|
||||
val locId = tw.getLocation(callsite)
|
||||
|
||||
extractRawMethodAccess(
|
||||
syntacticCallTarget,
|
||||
locId,
|
||||
callsite.type,
|
||||
enclosingCallable,
|
||||
callsiteParent,
|
||||
childIdx,
|
||||
enclosingStmt,
|
||||
valueArguments.size,
|
||||
{ argParent, idxOffset -> extractCallValueArguments(argParent, valueArguments, enclosingStmt, enclosingCallable, idxOffset) },
|
||||
dispatchReceiver?.type,
|
||||
dispatchReceiver?.let { { callId -> extractExpressionExpr(dispatchReceiver, enclosingCallable, callId, -1, enclosingStmt) } },
|
||||
extensionReceiver?.let { { argParent -> extractExpressionExpr(extensionReceiver, enclosingCallable, argParent, 0, enclosingStmt) } },
|
||||
typeArguments,
|
||||
extractClassTypeArguments
|
||||
)
|
||||
|
||||
}
|
||||
|
||||
|
||||
fun extractRawMethodAccess(
|
||||
syntacticCallTarget: IrFunction,
|
||||
locId: Label<DbLocation>,
|
||||
returnType: IrType,
|
||||
enclosingCallable: Label<out DbCallable>,
|
||||
callsiteParent: Label<out DbExprparent>,
|
||||
childIdx: Int,
|
||||
enclosingStmt: Label<out DbStmt>,
|
||||
nValueArguments: Int,
|
||||
extractValueArguments: (Label<out DbExpr>, Int) -> Unit,
|
||||
drType: IrType?,
|
||||
extractDispatchReceiver: ((Label<out DbExpr>) -> Unit)?,
|
||||
extractExtensionReceiver: ((Label<out DbExpr>) -> Unit)?,
|
||||
typeArguments: List<IrType> = listOf(),
|
||||
extractClassTypeArguments: Boolean = false) {
|
||||
|
||||
val callTarget = syntacticCallTarget.target.realOverrideTarget
|
||||
val id = tw.getFreshIdLabel<DbMethodaccess>()
|
||||
val type = useType(callsite.type)
|
||||
val locId = tw.getLocation(callsite)
|
||||
val type = useType(returnType)
|
||||
|
||||
tw.writeExprs_methodaccess(id, type.javaResult.id, callsiteParent, childIdx)
|
||||
tw.writeExprsKotlinType(id, type.kotlinResult.id)
|
||||
tw.writeHasLocation(id, locId)
|
||||
@@ -1320,8 +1439,6 @@ open class KotlinFileExtractor(
|
||||
// type arguments at index -2, -3, ...
|
||||
extractTypeArguments(typeArguments, locId, id, enclosingCallable, enclosingStmt, -2, true)
|
||||
|
||||
val drType = dispatchReceiver?.type
|
||||
|
||||
val isFunctionInvoke = drType != null
|
||||
&& drType is IrSimpleType
|
||||
&& drType.isFunctionOrKFunction()
|
||||
@@ -1364,44 +1481,48 @@ open class KotlinFileExtractor(
|
||||
|
||||
tw.writeCallableBinding(id, methodId)
|
||||
|
||||
if (dispatchReceiver != null) {
|
||||
extractExpressionExpr(dispatchReceiver, enclosingCallable, id, -1, enclosingStmt)
|
||||
} else if (isStaticFunction(callTarget)) {
|
||||
if (callTarget.shouldExtractAsStatic) {
|
||||
extractStaticTypeAccessQualifier(callTarget, id, locId, enclosingCallable, enclosingStmt)
|
||||
} else if (extractDispatchReceiver != null) {
|
||||
extractDispatchReceiver(id)
|
||||
}
|
||||
}
|
||||
|
||||
val idxOffset = if (extensionReceiver != null) 1 else 0
|
||||
val idxOffset = if (extractExtensionReceiver != null) 1 else 0
|
||||
|
||||
val argParent = if (isBigArityFunctionInvoke) {
|
||||
extractArrayCreationWithInitializer(id, valueArguments.size + idxOffset, locId, enclosingCallable, enclosingStmt)
|
||||
extractArrayCreationWithInitializer(id, nValueArguments + idxOffset, locId, enclosingCallable, enclosingStmt)
|
||||
} else {
|
||||
id
|
||||
}
|
||||
|
||||
if (extensionReceiver != null) {
|
||||
extractExpressionExpr(extensionReceiver, enclosingCallable, argParent, 0, enclosingStmt)
|
||||
if (extractExtensionReceiver != null) {
|
||||
extractExtensionReceiver(argParent)
|
||||
}
|
||||
|
||||
extractCallValueArguments(argParent, valueArguments, enclosingStmt, enclosingCallable, idxOffset)
|
||||
extractValueArguments(argParent, idxOffset)
|
||||
}
|
||||
|
||||
private fun extractStaticTypeAccessQualifier(target: IrDeclaration, parentExpr: Label<out DbExprparent>, locId: Label<DbLocation>, enclosingCallable: Label<out DbCallable>, enclosingStmt: Label<out DbStmt>) {
|
||||
if (target.isStaticOfClass) {
|
||||
if (target.shouldExtractAsStaticMemberOfClass) {
|
||||
extractTypeAccessRecursive(target.parentAsClass.toRawType(), locId, parentExpr, -1, enclosingCallable, enclosingStmt)
|
||||
} else if (target.isStaticOfFile) {
|
||||
} else if (target.shouldExtractAsStaticMemberOfFile) {
|
||||
extractTypeAccess(useFileClassType(target.parent as IrFile), locId, parentExpr, -1, enclosingCallable, enclosingStmt)
|
||||
}
|
||||
}
|
||||
|
||||
private val IrDeclaration.isStaticOfClass: Boolean
|
||||
get() = this.isStatic && parent is IrClass
|
||||
private val IrDeclaration.shouldExtractAsStaticMemberOfClass: Boolean
|
||||
get() = this.shouldExtractAsStatic && parent is IrClass
|
||||
|
||||
private val IrDeclaration.isStaticOfFile: Boolean
|
||||
get() = this.isStatic && parent is IrFile
|
||||
private val IrDeclaration.shouldExtractAsStaticMemberOfFile: Boolean
|
||||
get() = this.shouldExtractAsStatic && parent is IrFile
|
||||
|
||||
private val IrDeclaration.isStatic: Boolean
|
||||
get() = this is IrSimpleFunction && dispatchReceiverParameter == null ||
|
||||
private fun isStaticAnnotatedNonCompanionMember(f: IrSimpleFunction) =
|
||||
f.parentClassOrNull?.isNonCompanionObject == true &&
|
||||
(f.hasAnnotation(jvmStaticFqName) || f.correspondingPropertySymbol?.owner?.hasAnnotation(jvmStaticFqName) == true)
|
||||
|
||||
private val IrDeclaration.shouldExtractAsStatic: Boolean
|
||||
get() = this is IrSimpleFunction && (isStaticFunction(this) || isStaticAnnotatedNonCompanionMember(this)) ||
|
||||
this is IrField && this.isStatic ||
|
||||
this is IrEnumEntry
|
||||
|
||||
@@ -2623,78 +2744,22 @@ open class KotlinFileExtractor(
|
||||
val exprParent = parent.expr(e, callable)
|
||||
val owner = e.symbol.owner
|
||||
if (owner is IrValueParameter && owner.index == -1 && !owner.isExtensionReceiver()) {
|
||||
val id = tw.getFreshIdLabel<DbThisaccess>()
|
||||
val type = useType(e.type)
|
||||
val locId = tw.getLocation(e)
|
||||
tw.writeExprs_thisaccess(id, type.javaResult.id, exprParent.parent, exprParent.idx)
|
||||
tw.writeExprsKotlinType(id, type.kotlinResult.id)
|
||||
tw.writeHasLocation(id, locId)
|
||||
tw.writeCallableEnclosingExpr(id, callable)
|
||||
tw.writeStatementEnclosingExpr(id, exprParent.enclosingStmt)
|
||||
|
||||
|
||||
fun extractTypeAccess(parent: IrClass){
|
||||
extractTypeAccessRecursive(parent.typeWith(listOf()), locId, id, 0, callable, exprParent.enclosingStmt)
|
||||
}
|
||||
|
||||
when(val ownerParent = owner.parent) {
|
||||
is IrFunction -> {
|
||||
if (ownerParent.dispatchReceiverParameter == owner &&
|
||||
ownerParent.extensionReceiverParameter != null) {
|
||||
|
||||
val ownerParent2 = ownerParent.parent
|
||||
if (ownerParent2 is IrClass){
|
||||
extractTypeAccess(ownerParent2)
|
||||
} else {
|
||||
logger.errorElement("Unhandled qualifier for this", e)
|
||||
}
|
||||
}
|
||||
}
|
||||
is IrClass -> {
|
||||
if (ownerParent.thisReceiver == owner) {
|
||||
extractTypeAccess(ownerParent)
|
||||
}
|
||||
}
|
||||
else -> {
|
||||
logger.errorElement("Unexpected owner parent for this access: " + ownerParent.javaClass, e)
|
||||
}
|
||||
}
|
||||
extractThisAccess(e, exprParent, callable)
|
||||
} else {
|
||||
val id = tw.getFreshIdLabel<DbVaraccess>()
|
||||
val type = useType(e.type)
|
||||
val locId = tw.getLocation(e)
|
||||
tw.writeExprs_varaccess(id, type.javaResult.id, exprParent.parent, exprParent.idx)
|
||||
tw.writeExprsKotlinType(id, type.kotlinResult.id)
|
||||
tw.writeHasLocation(id, locId)
|
||||
tw.writeCallableEnclosingExpr(id, callable)
|
||||
tw.writeStatementEnclosingExpr(id, exprParent.enclosingStmt)
|
||||
|
||||
val vId = useValueDeclaration(owner)
|
||||
if (vId != null) {
|
||||
tw.writeVariableBinding(id, vId)
|
||||
}
|
||||
extractVariableAccess(useValueDeclaration(owner), e.type, tw.getLocation(e), exprParent.parent, exprParent.idx, callable, exprParent.enclosingStmt)
|
||||
}
|
||||
}
|
||||
is IrGetField -> {
|
||||
val exprParent = parent.expr(e, callable)
|
||||
val id = tw.getFreshIdLabel<DbVaraccess>()
|
||||
val type = useType(e.type)
|
||||
val locId = tw.getLocation(e)
|
||||
tw.writeExprs_varaccess(id, type.javaResult.id, exprParent.parent, exprParent.idx)
|
||||
tw.writeExprsKotlinType(id, type.kotlinResult.id)
|
||||
tw.writeHasLocation(id, locId)
|
||||
tw.writeCallableEnclosingExpr(id, callable)
|
||||
tw.writeStatementEnclosingExpr(id, exprParent.enclosingStmt)
|
||||
val owner = tryReplaceAndroidSyntheticField(e.symbol.owner)
|
||||
val vId = useField(owner)
|
||||
tw.writeVariableBinding(id, vId)
|
||||
tw.writeStatementEnclosingExpr(id, exprParent.enclosingStmt)
|
||||
|
||||
val receiver = e.receiver
|
||||
if (receiver != null) {
|
||||
extractExpressionExpr(receiver, callable, id, -1, exprParent.enclosingStmt)
|
||||
} else if (owner.isStatic) {
|
||||
extractStaticTypeAccessQualifier(owner, id, locId, callable, exprParent.enclosingStmt)
|
||||
val locId = tw.getLocation(e)
|
||||
extractVariableAccess(useField(owner), e.type, locId, exprParent.parent, exprParent.idx, callable, exprParent.enclosingStmt).also { id ->
|
||||
val receiver = e.receiver
|
||||
if (receiver != null) {
|
||||
extractExpressionExpr(receiver, callable, id, -1, exprParent.enclosingStmt)
|
||||
} else if (owner.isStatic) {
|
||||
extractStaticTypeAccessQualifier(owner, id, locId, callable, exprParent.enclosingStmt)
|
||||
}
|
||||
}
|
||||
}
|
||||
is IrGetEnumValue -> {
|
||||
@@ -2995,6 +3060,71 @@ open class KotlinFileExtractor(
|
||||
}
|
||||
}
|
||||
|
||||
private fun extractThisAccess(e: IrGetValue, exprParent: ExprParent, callable: Label<out DbCallable>) {
|
||||
val containingDeclaration = declarationStack.peek()
|
||||
val locId = tw.getLocation(e)
|
||||
val type = useType(e.type)
|
||||
|
||||
if (containingDeclaration.shouldExtractAsStatic && containingDeclaration.parentClassOrNull?.isNonCompanionObject == true) {
|
||||
// Use of `this` in a non-companion object member that will be lowered to a static function -- replace with a reference
|
||||
// to the corresponding static object instance.
|
||||
val instanceField = useObjectClassInstance(containingDeclaration.parentAsClass)
|
||||
extractVariableAccess(instanceField.id, e.type, locId, exprParent.parent, exprParent.idx, callable, exprParent.enclosingStmt).also { varAccessId ->
|
||||
extractStaticTypeAccessQualifier(containingDeclaration, varAccessId, locId, callable, exprParent.enclosingStmt)
|
||||
}
|
||||
} else {
|
||||
val id = tw.getFreshIdLabel<DbThisaccess>()
|
||||
|
||||
tw.writeExprs_thisaccess(id, type.javaResult.id, exprParent.parent, exprParent.idx)
|
||||
tw.writeExprsKotlinType(id, type.kotlinResult.id)
|
||||
tw.writeHasLocation(id, locId)
|
||||
tw.writeCallableEnclosingExpr(id, callable)
|
||||
tw.writeStatementEnclosingExpr(id, exprParent.enclosingStmt)
|
||||
|
||||
fun extractTypeAccess(parent: IrClass) {
|
||||
extractTypeAccessRecursive(parent.typeWith(listOf()), locId, id, 0, callable, exprParent.enclosingStmt)
|
||||
}
|
||||
|
||||
val owner = e.symbol.owner
|
||||
when(val ownerParent = owner.parent) {
|
||||
is IrFunction -> {
|
||||
if (ownerParent.dispatchReceiverParameter == owner &&
|
||||
ownerParent.extensionReceiverParameter != null) {
|
||||
|
||||
val ownerParent2 = ownerParent.parent
|
||||
if (ownerParent2 is IrClass){
|
||||
extractTypeAccess(ownerParent2)
|
||||
} else {
|
||||
logger.errorElement("Unhandled qualifier for this", e)
|
||||
}
|
||||
}
|
||||
}
|
||||
is IrClass -> {
|
||||
if (ownerParent.thisReceiver == owner) {
|
||||
extractTypeAccess(ownerParent)
|
||||
}
|
||||
}
|
||||
else -> {
|
||||
logger.errorElement("Unexpected owner parent for this access: " + ownerParent.javaClass, e)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun extractVariableAccess(variable: Label<out DbVariable>?, irType: IrType, locId: Label<out DbLocation>, parent: Label<out DbExprparent>, idx: Int, callable: Label<out DbCallable>, enclosingStmt: Label<out DbStmt>) =
|
||||
tw.getFreshIdLabel<DbVaraccess>().also {
|
||||
val type = useType(irType)
|
||||
tw.writeExprs_varaccess(it, type.javaResult.id, parent, idx)
|
||||
tw.writeExprsKotlinType(it, type.kotlinResult.id)
|
||||
tw.writeHasLocation(it, locId)
|
||||
tw.writeCallableEnclosingExpr(it, callable)
|
||||
tw.writeStatementEnclosingExpr(it, enclosingStmt)
|
||||
|
||||
if (variable != null) {
|
||||
tw.writeVariableBinding(it, variable)
|
||||
}
|
||||
}
|
||||
|
||||
private fun extractLoop(
|
||||
loop: IrLoop,
|
||||
stmtExprParent: StmtExprParent,
|
||||
@@ -4410,5 +4540,6 @@ open class KotlinFileExtractor(
|
||||
ENUM_CLASS_SPECIAL_MEMBER(5),
|
||||
DELEGATED_PROPERTY_GETTER(6),
|
||||
DELEGATED_PROPERTY_SETTER(7),
|
||||
JVMSTATIC_PROXY_METHOD(8),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -970,7 +970,7 @@ open class KotlinUsesExtractor(
|
||||
* allow it to be passed in.
|
||||
*/
|
||||
@OptIn(ObsoleteDescriptorBasedAPI::class)
|
||||
private fun getFunctionLabel(f: IrFunction, maybeParentId: Label<out DbElement>?, classTypeArgsIncludingOuterClasses: List<IrTypeArgument>?) =
|
||||
fun getFunctionLabel(f: IrFunction, maybeParentId: Label<out DbElement>?, classTypeArgsIncludingOuterClasses: List<IrTypeArgument>?) =
|
||||
getFunctionLabel(
|
||||
f.parent,
|
||||
maybeParentId,
|
||||
|
||||
@@ -48,7 +48,7 @@ c.kt:
|
||||
d.kt:
|
||||
# 0| [CompilationUnit] d
|
||||
# 1| 1: [Class] D
|
||||
# 0| 1: [FieldDeclaration] String bar;
|
||||
# 0| 2: [FieldDeclaration] String bar;
|
||||
# 0| -1: [TypeAccess] String
|
||||
# 0| 0: [StringLiteral] Foobar
|
||||
# 1| 3: [Constructor] D
|
||||
@@ -67,7 +67,7 @@ e.kt:
|
||||
# 0| -3: [TypeAccess] ArrayList<Object>
|
||||
# 0| 0: [IntegerLiteral] 1
|
||||
# 0| 0: [NullLiteral] null
|
||||
# 0| 1: [Method] <fn_LinkedHashMap>
|
||||
# 0| 2: [Method] <fn_LinkedHashMap>
|
||||
# 0| 3: [TypeAccess] Object
|
||||
# 0| 5: [BlockStmt] { ... }
|
||||
# 0| 0: [ReturnStmt] return ...
|
||||
|
||||
@@ -40,43 +40,19 @@ app/src/main/kotlin/testProject/App.kt:
|
||||
# 7| -1: [ThisAccess] Project.this
|
||||
# 7| 0: [TypeAccess] Project
|
||||
# 7| 1: [VarAccess] language
|
||||
# 0| 1: [Method] write$Self
|
||||
# 0| 3: [TypeAccess] Unit
|
||||
#-----| 4: (Parameters)
|
||||
# 0| 0: [Parameter] self
|
||||
# 0| 0: [TypeAccess] Project
|
||||
# 0| 1: [Parameter] output
|
||||
# 0| 0: [TypeAccess] CompositeEncoder
|
||||
# 0| 2: [Parameter] serialDesc
|
||||
# 0| 0: [TypeAccess] SerialDescriptor
|
||||
# 7| 5: [BlockStmt] { ... }
|
||||
# 7| 0: [ExprStmt] <Expr>;
|
||||
# 7| 0: [MethodAccess] encodeStringElement(...)
|
||||
# 7| -1: [VarAccess] output
|
||||
# 7| 0: [VarAccess] serialDesc
|
||||
# 7| 1: [IntegerLiteral] 0
|
||||
# 7| 2: [MethodAccess] getName(...)
|
||||
# 7| -1: [VarAccess] self
|
||||
# 7| 1: [ExprStmt] <Expr>;
|
||||
# 7| 0: [MethodAccess] encodeIntElement(...)
|
||||
# 7| -1: [VarAccess] output
|
||||
# 7| 0: [VarAccess] serialDesc
|
||||
# 7| 1: [IntegerLiteral] 1
|
||||
# 7| 2: [MethodAccess] getLanguage(...)
|
||||
# 7| -1: [VarAccess] self
|
||||
# 0| 1: [Method] component1
|
||||
# 0| 2: [Method] component1
|
||||
# 0| 3: [TypeAccess] String
|
||||
# 0| 5: [BlockStmt] { ... }
|
||||
# 0| 0: [ReturnStmt] return ...
|
||||
# 0| 0: [VarAccess] this.name
|
||||
# 0| -1: [ThisAccess] this
|
||||
# 0| 1: [Method] component2
|
||||
# 0| 3: [Method] component2
|
||||
# 0| 3: [TypeAccess] int
|
||||
# 0| 5: [BlockStmt] { ... }
|
||||
# 0| 0: [ReturnStmt] return ...
|
||||
# 0| 0: [VarAccess] this.language
|
||||
# 0| -1: [ThisAccess] this
|
||||
# 0| 1: [Method] copy
|
||||
# 0| 4: [Method] copy
|
||||
# 0| 3: [TypeAccess] Project
|
||||
#-----| 4: (Parameters)
|
||||
# 8| 0: [Parameter] name
|
||||
@@ -89,41 +65,7 @@ app/src/main/kotlin/testProject/App.kt:
|
||||
# 0| -3: [TypeAccess] Project
|
||||
# 0| 0: [VarAccess] name
|
||||
# 0| 1: [VarAccess] language
|
||||
# 0| 1: [Method] toString
|
||||
# 0| 3: [TypeAccess] String
|
||||
# 0| 5: [BlockStmt] { ... }
|
||||
# 0| 0: [ReturnStmt] return ...
|
||||
# 0| 0: [StringTemplateExpr] "..."
|
||||
# 0| 0: [StringLiteral] Project(
|
||||
# 0| 1: [StringLiteral] name=
|
||||
# 0| 2: [VarAccess] this.name
|
||||
# 0| -1: [ThisAccess] this
|
||||
# 0| 3: [StringLiteral] ,
|
||||
# 0| 4: [StringLiteral] language=
|
||||
# 0| 5: [VarAccess] this.language
|
||||
# 0| -1: [ThisAccess] this
|
||||
# 0| 6: [StringLiteral] )
|
||||
# 0| 1: [Method] hashCode
|
||||
# 0| 3: [TypeAccess] int
|
||||
# 0| 5: [BlockStmt] { ... }
|
||||
# 0| 0: [LocalVariableDeclStmt] var ...;
|
||||
# 0| 1: [LocalVariableDeclExpr] result
|
||||
# 0| 0: [MethodAccess] hashCode(...)
|
||||
# 0| -1: [VarAccess] this.name
|
||||
# 0| -1: [ThisAccess] this
|
||||
# 0| 1: [ExprStmt] <Expr>;
|
||||
# 0| 0: [AssignExpr] ...=...
|
||||
# 0| 0: [VarAccess] result
|
||||
# 0| 1: [MethodAccess] plus(...)
|
||||
# 0| -1: [MethodAccess] times(...)
|
||||
# 0| -1: [VarAccess] result
|
||||
# 0| 0: [IntegerLiteral] 31
|
||||
# 0| 0: [MethodAccess] hashCode(...)
|
||||
# 0| -1: [VarAccess] this.language
|
||||
# 0| -1: [ThisAccess] this
|
||||
# 0| 2: [ReturnStmt] return ...
|
||||
# 0| 0: [VarAccess] result
|
||||
# 0| 1: [Method] equals
|
||||
# 0| 5: [Method] equals
|
||||
# 0| 3: [TypeAccess] boolean
|
||||
#-----| 4: (Parameters)
|
||||
# 0| 0: [Parameter] other
|
||||
@@ -172,27 +114,68 @@ app/src/main/kotlin/testProject/App.kt:
|
||||
# 0| 0: [BooleanLiteral] false
|
||||
# 0| 5: [ReturnStmt] return ...
|
||||
# 0| 0: [BooleanLiteral] true
|
||||
# 7| 9: [Class] Companion
|
||||
# 0| 1: [Method] serializer
|
||||
# 0| 3: [TypeAccess] KSerializer<Project>
|
||||
# 0| 0: [TypeAccess] Project
|
||||
# 7| 5: [BlockStmt] { ... }
|
||||
# 7| 0: [ReturnStmt] return ...
|
||||
# 7| 0: [VarAccess] INSTANCE
|
||||
# 7| 2: [Constructor] Companion
|
||||
# 7| 5: [BlockStmt] { ... }
|
||||
# 7| 0: [SuperConstructorInvocationStmt] super(...)
|
||||
# 7| 1: [BlockStmt] { ... }
|
||||
# 7| 9: [Class] $serializer
|
||||
# 0| 1: [Method] getDescriptor
|
||||
# 0| 3: [TypeAccess] SerialDescriptor
|
||||
# 0| 5: [BlockStmt] { ... }
|
||||
# 0| 0: [ReturnStmt] return ...
|
||||
# 0| 0: [VarAccess] this.descriptor
|
||||
# 0| 6: [Method] hashCode
|
||||
# 0| 3: [TypeAccess] int
|
||||
# 0| 5: [BlockStmt] { ... }
|
||||
# 0| 0: [LocalVariableDeclStmt] var ...;
|
||||
# 0| 1: [LocalVariableDeclExpr] result
|
||||
# 0| 0: [MethodAccess] hashCode(...)
|
||||
# 0| -1: [VarAccess] this.name
|
||||
# 0| -1: [ThisAccess] this
|
||||
# 0| 1: [ExprStmt] <Expr>;
|
||||
# 0| 0: [AssignExpr] ...=...
|
||||
# 0| 0: [VarAccess] result
|
||||
# 0| 1: [MethodAccess] plus(...)
|
||||
# 0| -1: [MethodAccess] times(...)
|
||||
# 0| -1: [VarAccess] result
|
||||
# 0| 0: [IntegerLiteral] 31
|
||||
# 0| 0: [MethodAccess] hashCode(...)
|
||||
# 0| -1: [VarAccess] this.language
|
||||
# 0| -1: [ThisAccess] this
|
||||
# 0| 2: [ReturnStmt] return ...
|
||||
# 0| 0: [VarAccess] result
|
||||
# 0| 7: [Method] toString
|
||||
# 0| 3: [TypeAccess] String
|
||||
# 0| 5: [BlockStmt] { ... }
|
||||
# 0| 0: [ReturnStmt] return ...
|
||||
# 0| 0: [StringTemplateExpr] "..."
|
||||
# 0| 0: [StringLiteral] Project(
|
||||
# 0| 1: [StringLiteral] name=
|
||||
# 0| 2: [VarAccess] this.name
|
||||
# 0| -1: [ThisAccess] this
|
||||
# 0| 3: [StringLiteral] ,
|
||||
# 0| 4: [StringLiteral] language=
|
||||
# 0| 5: [VarAccess] this.language
|
||||
# 0| -1: [ThisAccess] this
|
||||
# 0| 6: [StringLiteral] )
|
||||
# 0| 8: [Method] write$Self
|
||||
# 0| 3: [TypeAccess] Unit
|
||||
#-----| 4: (Parameters)
|
||||
# 0| 0: [Parameter] self
|
||||
# 0| 0: [TypeAccess] Project
|
||||
# 0| 1: [Parameter] output
|
||||
# 0| 0: [TypeAccess] CompositeEncoder
|
||||
# 0| 2: [Parameter] serialDesc
|
||||
# 0| 0: [TypeAccess] SerialDescriptor
|
||||
# 7| 5: [BlockStmt] { ... }
|
||||
# 7| 0: [ExprStmt] <Expr>;
|
||||
# 7| 0: [MethodAccess] encodeStringElement(...)
|
||||
# 7| -1: [VarAccess] output
|
||||
# 7| 0: [VarAccess] serialDesc
|
||||
# 7| 1: [IntegerLiteral] 0
|
||||
# 7| 2: [MethodAccess] getName(...)
|
||||
# 7| -1: [VarAccess] self
|
||||
# 7| 1: [ExprStmt] <Expr>;
|
||||
# 7| 0: [MethodAccess] encodeIntElement(...)
|
||||
# 7| -1: [VarAccess] output
|
||||
# 7| 0: [VarAccess] serialDesc
|
||||
# 7| 1: [IntegerLiteral] 1
|
||||
# 7| 2: [MethodAccess] getLanguage(...)
|
||||
# 7| -1: [VarAccess] self
|
||||
# 7| 9: [Class] $serializer
|
||||
# 0| 1: [FieldDeclaration] SerialDescriptor descriptor;
|
||||
# 0| -1: [TypeAccess] SerialDescriptor
|
||||
# 0| 1: [Method] childSerializers
|
||||
# 0| 2: [Method] childSerializers
|
||||
# 0| 3: [TypeAccess] KSerializer<?>[]
|
||||
# 0| 0: [TypeAccess] KSerializer<?>
|
||||
# 0| 0: [WildcardTypeAccess] ? ...
|
||||
@@ -204,7 +187,7 @@ app/src/main/kotlin/testProject/App.kt:
|
||||
# 7| 1: [VarAccess] INSTANCE
|
||||
# 7| -1: [TypeAccess] KSerializer<?>
|
||||
# 7| 0: [IntegerLiteral] 2
|
||||
# 0| 1: [Method] deserialize
|
||||
# 0| 3: [Method] deserialize
|
||||
# 0| 3: [TypeAccess] Project
|
||||
#-----| 4: (Parameters)
|
||||
# 0| 0: [Parameter] decoder
|
||||
@@ -342,7 +325,13 @@ app/src/main/kotlin/testProject/App.kt:
|
||||
# 7| 1: [VarAccess] tmp4_local0
|
||||
# 7| 2: [VarAccess] tmp5_local1
|
||||
# 7| 3: [NullLiteral] null
|
||||
# 0| 1: [Method] serialize
|
||||
# 0| 4: [Method] getDescriptor
|
||||
# 0| 3: [TypeAccess] SerialDescriptor
|
||||
# 0| 5: [BlockStmt] { ... }
|
||||
# 0| 0: [ReturnStmt] return ...
|
||||
# 0| 0: [VarAccess] this.descriptor
|
||||
# 0| -1: [ThisAccess] this
|
||||
# 0| 5: [Method] serialize
|
||||
# 0| 3: [TypeAccess] Unit
|
||||
#-----| 4: (Parameters)
|
||||
# 0| 0: [Parameter] encoder
|
||||
@@ -397,6 +386,17 @@ app/src/main/kotlin/testProject/App.kt:
|
||||
# 7| -1: [ThisAccess] $serializer.this
|
||||
# 7| 0: [TypeAccess] $serializer
|
||||
# 7| 1: [VarAccess] tmp0_serialDesc
|
||||
# 7| 10: [Class] Companion
|
||||
# 0| 1: [Method] serializer
|
||||
# 0| 3: [TypeAccess] KSerializer<Project>
|
||||
# 0| 0: [TypeAccess] Project
|
||||
# 7| 5: [BlockStmt] { ... }
|
||||
# 7| 0: [ReturnStmt] return ...
|
||||
# 7| 0: [VarAccess] INSTANCE
|
||||
# 7| 2: [Constructor] Companion
|
||||
# 7| 5: [BlockStmt] { ... }
|
||||
# 7| 0: [SuperConstructorInvocationStmt] super(...)
|
||||
# 7| 1: [BlockStmt] { ... }
|
||||
# 8| 11: [Constructor] Project
|
||||
#-----| 4: (Parameters)
|
||||
# 8| 0: [Parameter] name
|
||||
@@ -412,21 +412,21 @@ app/src/main/kotlin/testProject/App.kt:
|
||||
# 8| 1: [ExprStmt] <Expr>;
|
||||
# 8| 0: [KtInitializerAssignExpr] ...=...
|
||||
# 8| 0: [VarAccess] language
|
||||
# 8| 12: [Method] getName
|
||||
# 8| 12: [FieldDeclaration] String name;
|
||||
# 8| -1: [TypeAccess] String
|
||||
# 8| 0: [VarAccess] name
|
||||
# 8| 13: [Method] getName
|
||||
# 8| 3: [TypeAccess] String
|
||||
# 8| 5: [BlockStmt] { ... }
|
||||
# 8| 0: [ReturnStmt] return ...
|
||||
# 8| 0: [VarAccess] this.name
|
||||
# 8| -1: [ThisAccess] this
|
||||
# 8| 12: [FieldDeclaration] String name;
|
||||
# 8| -1: [TypeAccess] String
|
||||
# 8| 0: [VarAccess] name
|
||||
# 8| 14: [Method] getLanguage
|
||||
# 8| 3: [TypeAccess] int
|
||||
# 8| 5: [BlockStmt] { ... }
|
||||
# 8| 0: [ReturnStmt] return ...
|
||||
# 8| 0: [VarAccess] this.language
|
||||
# 8| -1: [ThisAccess] this
|
||||
# 8| 14: [FieldDeclaration] int language;
|
||||
# 8| 15: [FieldDeclaration] int language;
|
||||
# 8| -1: [TypeAccess] int
|
||||
# 8| 0: [VarAccess] language
|
||||
|
||||
@@ -57,6 +57,12 @@ class Element extends @element, Top {
|
||||
i = 4 and result = "Class initialisation method <clinit>"
|
||||
or
|
||||
i = 5 and result = "Enum class special member"
|
||||
or
|
||||
i = 6 and result = "Getter for a Kotlin delegated property"
|
||||
or
|
||||
i = 7 and result = "Setter for a Kotlin delegated property"
|
||||
or
|
||||
i = 8 and result = "Proxy static method for a @JvmStatic-annotated function or property"
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -534,10 +534,12 @@ final class ClassInterfaceNode extends ElementNode {
|
||||
or
|
||||
childIndex >= 0 and
|
||||
result.(ElementNode).getElement() =
|
||||
rank[childIndex](Element e, string file, int line, int column |
|
||||
e = this.getADeclaration() and locationSortKeys(e, file, line, column)
|
||||
rank[childIndex](Element e, string file, int line, int column, string childStr |
|
||||
e = this.getADeclaration() and
|
||||
locationSortKeys(e, file, line, column) and
|
||||
childStr = e.toString()
|
||||
|
|
||||
e order by file, line, column
|
||||
e order by file, line, column, childStr
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32,7 +32,7 @@ classes.kt:
|
||||
# 4| 0: [ReturnStmt] return ...
|
||||
# 4| 0: [VarAccess] this.arg
|
||||
# 4| -1: [ThisAccess] this
|
||||
# 4| 2: [FieldDeclaration] int arg;
|
||||
# 4| 3: [FieldDeclaration] int arg;
|
||||
# 4| -1: [TypeAccess] int
|
||||
# 4| 0: [VarAccess] arg
|
||||
# 5| 4: [Method] getX
|
||||
@@ -41,7 +41,7 @@ classes.kt:
|
||||
# 5| 0: [ReturnStmt] return ...
|
||||
# 5| 0: [VarAccess] this.x
|
||||
# 5| -1: [ThisAccess] this
|
||||
# 5| 4: [FieldDeclaration] int x;
|
||||
# 5| 5: [FieldDeclaration] int x;
|
||||
# 5| -1: [TypeAccess] int
|
||||
# 5| 0: [IntegerLiteral] 3
|
||||
# 8| 4: [Class] ClassThree
|
||||
@@ -118,18 +118,18 @@ classes.kt:
|
||||
# 42| 0: [ReturnStmt] return ...
|
||||
# 42| 0: [VarAccess] this.x
|
||||
# 42| -1: [ThisAccess] this
|
||||
# 42| 2: [FieldDeclaration] int x;
|
||||
# 42| 3: [FieldDeclaration] int x;
|
||||
# 42| -1: [TypeAccess] int
|
||||
# 42| 0: [IntegerLiteral] 3
|
||||
# 49| 11: [Class] Direction
|
||||
# 0| 1: [Method] values
|
||||
# 0| 3: [TypeAccess] Direction[]
|
||||
# 0| 0: [TypeAccess] Direction
|
||||
# 0| 1: [Method] valueOf
|
||||
# 0| 2: [Method] valueOf
|
||||
# 0| 3: [TypeAccess] Direction
|
||||
#-----| 4: (Parameters)
|
||||
# 0| 0: [Parameter] value
|
||||
# 0| 0: [TypeAccess] String
|
||||
# 0| 3: [Method] values
|
||||
# 0| 3: [TypeAccess] Direction[]
|
||||
# 0| 0: [TypeAccess] Direction
|
||||
# 49| 4: [Constructor] Direction
|
||||
# 49| 5: [BlockStmt] { ... }
|
||||
# 49| 0: [ExprStmt] <Expr>;
|
||||
@@ -154,14 +154,14 @@ classes.kt:
|
||||
# 50| 0: [ClassInstanceExpr] new Direction(...)
|
||||
# 50| -3: [TypeAccess] Direction
|
||||
# 53| 12: [Class] Color
|
||||
# 0| 1: [Method] values
|
||||
# 0| 3: [TypeAccess] Color[]
|
||||
# 0| 0: [TypeAccess] Color
|
||||
# 0| 1: [Method] valueOf
|
||||
# 0| 2: [Method] valueOf
|
||||
# 0| 3: [TypeAccess] Color
|
||||
#-----| 4: (Parameters)
|
||||
# 0| 0: [Parameter] value
|
||||
# 0| 0: [TypeAccess] String
|
||||
# 0| 3: [Method] values
|
||||
# 0| 3: [TypeAccess] Color[]
|
||||
# 0| 0: [TypeAccess] Color
|
||||
# 53| 4: [Constructor] Color
|
||||
#-----| 4: (Parameters)
|
||||
# 53| 0: [Parameter] rgb
|
||||
@@ -181,7 +181,7 @@ classes.kt:
|
||||
# 53| 0: [ReturnStmt] return ...
|
||||
# 53| 0: [VarAccess] this.rgb
|
||||
# 53| -1: [ThisAccess] this
|
||||
# 53| 5: [FieldDeclaration] int rgb;
|
||||
# 53| 6: [FieldDeclaration] int rgb;
|
||||
# 53| -1: [TypeAccess] int
|
||||
# 53| 0: [VarAccess] rgb
|
||||
# 54| 7: [FieldDeclaration] Color RED;
|
||||
@@ -266,7 +266,7 @@ classes.kt:
|
||||
# 73| 0: [ReturnStmt] return ...
|
||||
# 73| 0: [VarAccess] this.x
|
||||
# 73| -1: [ThisAccess] this
|
||||
# 73| 2: [FieldDeclaration] int x;
|
||||
# 73| 3: [FieldDeclaration] int x;
|
||||
# 73| -1: [TypeAccess] int
|
||||
# 73| 0: [IntegerLiteral] 1
|
||||
# 74| 4: [Method] foo
|
||||
@@ -434,7 +434,7 @@ classes.kt:
|
||||
# 118| 1: [Constructor]
|
||||
# 118| 5: [BlockStmt] { ... }
|
||||
# 118| 0: [SuperConstructorInvocationStmt] super(...)
|
||||
# 118| 1: [Method] localFn
|
||||
# 118| 2: [Method] localFn
|
||||
# 118| 3: [TypeAccess] Unit
|
||||
# 118| 5: [BlockStmt] { ... }
|
||||
# 119| 0: [LocalTypeDeclStmt] class ...
|
||||
@@ -541,15 +541,15 @@ generic_anonymous.kt:
|
||||
# 3| 1: [ExprStmt] <Expr>;
|
||||
# 3| 0: [KtInitializerAssignExpr] ...=...
|
||||
# 3| 0: [VarAccess] x
|
||||
# 1| 2: [Method] getT
|
||||
# 1| 2: [FieldDeclaration] T t;
|
||||
# 1| -1: [TypeAccess] T
|
||||
# 1| 0: [VarAccess] t
|
||||
# 1| 3: [Method] getT
|
||||
# 1| 3: [TypeAccess] T
|
||||
# 1| 5: [BlockStmt] { ... }
|
||||
# 1| 0: [ReturnStmt] return ...
|
||||
# 1| 0: [VarAccess] this.t
|
||||
# 1| -1: [ThisAccess] this
|
||||
# 1| 2: [FieldDeclaration] T t;
|
||||
# 1| -1: [TypeAccess] T
|
||||
# 1| 0: [VarAccess] t
|
||||
# 3| 4: [FieldDeclaration] new Object(...) { ... } x;
|
||||
# 3| -1: [TypeAccess] new Object(...) { ... }
|
||||
# 3| 0: [TypeAccess] T
|
||||
@@ -564,17 +564,17 @@ generic_anonymous.kt:
|
||||
# 4| 0: [ExprStmt] <Expr>;
|
||||
# 4| 0: [KtInitializerAssignExpr] ...=...
|
||||
# 4| 0: [VarAccess] member
|
||||
# 4| 2: [Method] getMember
|
||||
# 4| 3: [TypeAccess] T
|
||||
# 4| 5: [BlockStmt] { ... }
|
||||
# 4| 0: [ReturnStmt] return ...
|
||||
# 4| 0: [VarAccess] this.member
|
||||
# 4| -1: [ThisAccess] this
|
||||
# 4| 2: [FieldDeclaration] T member;
|
||||
# 4| -1: [TypeAccess] T
|
||||
# 4| 0: [MethodAccess] getT(...)
|
||||
# 4| -1: [ThisAccess] Generic.this
|
||||
# 4| 0: [TypeAccess] Generic
|
||||
# 4| 3: [Method] getMember
|
||||
# 4| 3: [TypeAccess] T
|
||||
# 4| 5: [BlockStmt] { ... }
|
||||
# 4| 0: [ReturnStmt] return ...
|
||||
# 4| 0: [VarAccess] this.member
|
||||
# 4| -1: [ThisAccess] this
|
||||
# 3| 1: [ExprStmt] <Expr>;
|
||||
# 3| 0: [ClassInstanceExpr] new (...)
|
||||
# 3| -3: [TypeAccess] Object
|
||||
@@ -605,12 +605,6 @@ localClassField.kt:
|
||||
# 7| 1: [ExprStmt] <Expr>;
|
||||
# 7| 0: [KtInitializerAssignExpr] ...=...
|
||||
# 7| 0: [VarAccess] y
|
||||
# 2| 2: [Method] getX
|
||||
# 2| 3: [TypeAccess] Object
|
||||
# 2| 5: [BlockStmt] { ... }
|
||||
# 2| 0: [ReturnStmt] return ...
|
||||
# 2| 0: [VarAccess] this.x
|
||||
# 2| -1: [ThisAccess] this
|
||||
# 2| 2: [FieldDeclaration] Object x;
|
||||
# 2| -1: [TypeAccess] Object
|
||||
# 2| 0: [WhenExpr] when ...
|
||||
@@ -629,12 +623,12 @@ localClassField.kt:
|
||||
# 2| 1: [WhenBranch] ... -> ...
|
||||
# 2| 0: [BooleanLiteral] true
|
||||
# 5| 1: [BlockStmt] { ... }
|
||||
# 7| 4: [Method] getY
|
||||
# 7| 3: [TypeAccess] Object
|
||||
# 7| 5: [BlockStmt] { ... }
|
||||
# 7| 0: [ReturnStmt] return ...
|
||||
# 7| 0: [VarAccess] this.y
|
||||
# 7| -1: [ThisAccess] this
|
||||
# 2| 3: [Method] getX
|
||||
# 2| 3: [TypeAccess] Object
|
||||
# 2| 5: [BlockStmt] { ... }
|
||||
# 2| 0: [ReturnStmt] return ...
|
||||
# 2| 0: [VarAccess] this.x
|
||||
# 2| -1: [ThisAccess] this
|
||||
# 7| 4: [FieldDeclaration] Object y;
|
||||
# 7| -1: [TypeAccess] Object
|
||||
# 7| 0: [WhenExpr] when ...
|
||||
@@ -653,6 +647,12 @@ localClassField.kt:
|
||||
# 7| 1: [WhenBranch] ... -> ...
|
||||
# 7| 0: [BooleanLiteral] true
|
||||
# 10| 1: [BlockStmt] { ... }
|
||||
# 7| 5: [Method] getY
|
||||
# 7| 3: [TypeAccess] Object
|
||||
# 7| 5: [BlockStmt] { ... }
|
||||
# 7| 0: [ReturnStmt] return ...
|
||||
# 7| 0: [VarAccess] this.y
|
||||
# 7| -1: [ThisAccess] this
|
||||
local_anonymous.kt:
|
||||
# 0| [CompilationUnit] local_anonymous
|
||||
# 3| 1: [Class] Class1
|
||||
@@ -686,7 +686,7 @@ local_anonymous.kt:
|
||||
# 11| 1: [Constructor]
|
||||
# 11| 5: [BlockStmt] { ... }
|
||||
# 11| 0: [SuperConstructorInvocationStmt] super(...)
|
||||
# 11| 1: [Method] fnLocal
|
||||
# 11| 2: [Method] fnLocal
|
||||
# 11| 3: [TypeAccess] Unit
|
||||
# 11| 5: [BlockStmt] { ... }
|
||||
# 12| 1: [ExprStmt] <Expr>;
|
||||
@@ -703,7 +703,7 @@ local_anonymous.kt:
|
||||
# 16| 1: [Constructor]
|
||||
# 16| 5: [BlockStmt] { ... }
|
||||
# 16| 0: [SuperConstructorInvocationStmt] super(...)
|
||||
# 16| 1: [Method] invoke
|
||||
# 16| 2: [Method] invoke
|
||||
# 16| 3: [TypeAccess] int
|
||||
#-----| 4: (Parameters)
|
||||
# 16| 0: [Parameter] a
|
||||
@@ -726,7 +726,7 @@ local_anonymous.kt:
|
||||
# 17| 1: [Constructor]
|
||||
# 17| 5: [BlockStmt] { ... }
|
||||
# 17| 0: [SuperConstructorInvocationStmt] super(...)
|
||||
# 17| 1: [Method] invoke
|
||||
# 17| 2: [Method] invoke
|
||||
# 17| 3: [TypeAccess] int
|
||||
#-----| 4: (Parameters)
|
||||
# 17| 0: [Parameter] a
|
||||
@@ -752,7 +752,7 @@ local_anonymous.kt:
|
||||
# 21| 1: [Constructor]
|
||||
# 21| 5: [BlockStmt] { ... }
|
||||
# 21| 0: [SuperConstructorInvocationStmt] super(...)
|
||||
# 21| 1: [Method] invoke
|
||||
# 21| 2: [Method] invoke
|
||||
#-----| 4: (Parameters)
|
||||
# 21| 0: [Parameter] a0
|
||||
# 21| 5: [BlockStmt] { ... }
|
||||
@@ -797,7 +797,10 @@ local_anonymous.kt:
|
||||
# 30| 0: [ReturnStmt] return ...
|
||||
# 30| 0: [VarAccess] this.x
|
||||
# 30| -1: [ThisAccess] this
|
||||
# 30| 2: [Method] setX
|
||||
# 30| 3: [FieldDeclaration] int x;
|
||||
# 30| -1: [TypeAccess] int
|
||||
# 30| 0: [IntegerLiteral] 1
|
||||
# 30| 4: [Method] setX
|
||||
# 30| 3: [TypeAccess] Unit
|
||||
#-----| 4: (Parameters)
|
||||
# 30| 0: [Parameter] <set-?>
|
||||
@@ -808,9 +811,6 @@ local_anonymous.kt:
|
||||
# 30| 0: [VarAccess] this.x
|
||||
# 30| -1: [ThisAccess] this
|
||||
# 30| 1: [VarAccess] <set-?>
|
||||
# 30| 2: [FieldDeclaration] int x;
|
||||
# 30| -1: [TypeAccess] int
|
||||
# 30| 0: [IntegerLiteral] 1
|
||||
# 32| 5: [Method] member
|
||||
# 32| 3: [TypeAccess] Unit
|
||||
# 32| 5: [BlockStmt] { ... }
|
||||
@@ -840,23 +840,6 @@ local_anonymous.kt:
|
||||
# 40| 0: [ExprStmt] <Expr>;
|
||||
# 40| 0: [KtInitializerAssignExpr] ...=...
|
||||
# 40| 0: [VarAccess] i
|
||||
# 40| 2: [Method] getI
|
||||
# 40| 3: [TypeAccess] Interface2
|
||||
# 40| 5: [BlockStmt] { ... }
|
||||
# 40| 0: [ReturnStmt] return ...
|
||||
# 40| 0: [VarAccess] this.i
|
||||
# 40| -1: [ThisAccess] this
|
||||
# 40| 2: [Method] setI
|
||||
# 40| 3: [TypeAccess] Unit
|
||||
#-----| 4: (Parameters)
|
||||
# 40| 0: [Parameter] <set-?>
|
||||
# 40| 0: [TypeAccess] Interface2
|
||||
# 40| 5: [BlockStmt] { ... }
|
||||
# 40| 0: [ExprStmt] <Expr>;
|
||||
# 40| 0: [AssignExpr] ...=...
|
||||
# 40| 0: [VarAccess] this.i
|
||||
# 40| -1: [ThisAccess] this
|
||||
# 40| 1: [VarAccess] <set-?>
|
||||
# 40| 2: [FieldDeclaration] Interface2 i;
|
||||
# 40| -1: [TypeAccess] Interface2
|
||||
# 40| 0: [StmtExpr] <Stmt>
|
||||
@@ -873,6 +856,23 @@ local_anonymous.kt:
|
||||
# 40| 1: [ExprStmt] <Expr>;
|
||||
# 40| 0: [ClassInstanceExpr] new (...)
|
||||
# 40| -3: [TypeAccess] Interface2
|
||||
# 40| 3: [Method] getI
|
||||
# 40| 3: [TypeAccess] Interface2
|
||||
# 40| 5: [BlockStmt] { ... }
|
||||
# 40| 0: [ReturnStmt] return ...
|
||||
# 40| 0: [VarAccess] this.i
|
||||
# 40| -1: [ThisAccess] this
|
||||
# 40| 4: [Method] setI
|
||||
# 40| 3: [TypeAccess] Unit
|
||||
#-----| 4: (Parameters)
|
||||
# 40| 0: [Parameter] <set-?>
|
||||
# 40| 0: [TypeAccess] Interface2
|
||||
# 40| 5: [BlockStmt] { ... }
|
||||
# 40| 0: [ExprStmt] <Expr>;
|
||||
# 40| 0: [AssignExpr] ...=...
|
||||
# 40| 0: [VarAccess] this.i
|
||||
# 40| -1: [ThisAccess] this
|
||||
# 40| 1: [VarAccess] <set-?>
|
||||
superChain.kt:
|
||||
# 0| [CompilationUnit] superChain
|
||||
# 1| 1: [Class,GenericType,ParameterizedType] SuperChain1
|
||||
|
||||
@@ -7,14 +7,14 @@ dc.kt:
|
||||
# 0| 0: [ReturnStmt] return ...
|
||||
# 0| 0: [VarAccess] this.bytes
|
||||
# 0| -1: [ThisAccess] this
|
||||
# 0| 1: [Method] component2
|
||||
# 0| 2: [Method] component2
|
||||
# 0| 3: [TypeAccess] String[]
|
||||
# 0| 0: [TypeAccess] String
|
||||
# 0| 5: [BlockStmt] { ... }
|
||||
# 0| 0: [ReturnStmt] return ...
|
||||
# 0| 0: [VarAccess] this.strs
|
||||
# 0| -1: [ThisAccess] this
|
||||
# 0| 1: [Method] copy
|
||||
# 0| 3: [Method] copy
|
||||
# 0| 3: [TypeAccess] ProtoMapValue
|
||||
#-----| 4: (Parameters)
|
||||
# 1| 0: [Parameter] bytes
|
||||
@@ -28,47 +28,7 @@ dc.kt:
|
||||
# 0| -3: [TypeAccess] ProtoMapValue
|
||||
# 0| 0: [VarAccess] bytes
|
||||
# 0| 1: [VarAccess] strs
|
||||
# 0| 1: [Method] toString
|
||||
# 0| 3: [TypeAccess] String
|
||||
# 0| 5: [BlockStmt] { ... }
|
||||
# 0| 0: [ReturnStmt] return ...
|
||||
# 0| 0: [StringTemplateExpr] "..."
|
||||
# 0| 0: [StringLiteral] ProtoMapValue(
|
||||
# 0| 1: [StringLiteral] bytes=
|
||||
# 0| 2: [MethodAccess] toString(...)
|
||||
# 0| -1: [TypeAccess] Arrays
|
||||
# 0| 0: [VarAccess] this.bytes
|
||||
# 0| -1: [ThisAccess] this
|
||||
# 0| 3: [StringLiteral] ,
|
||||
# 0| 4: [StringLiteral] strs=
|
||||
# 0| 5: [MethodAccess] toString(...)
|
||||
# 0| -1: [TypeAccess] Arrays
|
||||
# 0| 0: [VarAccess] this.strs
|
||||
# 0| -1: [ThisAccess] this
|
||||
# 0| 6: [StringLiteral] )
|
||||
# 0| 1: [Method] hashCode
|
||||
# 0| 3: [TypeAccess] int
|
||||
# 0| 5: [BlockStmt] { ... }
|
||||
# 0| 0: [LocalVariableDeclStmt] var ...;
|
||||
# 0| 1: [LocalVariableDeclExpr] result
|
||||
# 0| 0: [MethodAccess] hashCode(...)
|
||||
# 0| -1: [TypeAccess] Arrays
|
||||
# 0| 0: [VarAccess] this.bytes
|
||||
# 0| -1: [ThisAccess] this
|
||||
# 0| 1: [ExprStmt] <Expr>;
|
||||
# 0| 0: [AssignExpr] ...=...
|
||||
# 0| 0: [VarAccess] result
|
||||
# 0| 1: [MethodAccess] plus(...)
|
||||
# 0| -1: [MethodAccess] times(...)
|
||||
# 0| -1: [VarAccess] result
|
||||
# 0| 0: [IntegerLiteral] 31
|
||||
# 0| 0: [MethodAccess] hashCode(...)
|
||||
# 0| -1: [TypeAccess] Arrays
|
||||
# 0| 0: [VarAccess] this.strs
|
||||
# 0| -1: [ThisAccess] this
|
||||
# 0| 2: [ReturnStmt] return ...
|
||||
# 0| 0: [VarAccess] result
|
||||
# 0| 1: [Method] equals
|
||||
# 0| 4: [Method] equals
|
||||
# 0| 3: [TypeAccess] boolean
|
||||
#-----| 4: (Parameters)
|
||||
# 0| 0: [Parameter] other
|
||||
@@ -117,6 +77,46 @@ dc.kt:
|
||||
# 0| 0: [BooleanLiteral] false
|
||||
# 0| 5: [ReturnStmt] return ...
|
||||
# 0| 0: [BooleanLiteral] true
|
||||
# 0| 5: [Method] hashCode
|
||||
# 0| 3: [TypeAccess] int
|
||||
# 0| 5: [BlockStmt] { ... }
|
||||
# 0| 0: [LocalVariableDeclStmt] var ...;
|
||||
# 0| 1: [LocalVariableDeclExpr] result
|
||||
# 0| 0: [MethodAccess] hashCode(...)
|
||||
# 0| -1: [TypeAccess] Arrays
|
||||
# 0| 0: [VarAccess] this.bytes
|
||||
# 0| -1: [ThisAccess] this
|
||||
# 0| 1: [ExprStmt] <Expr>;
|
||||
# 0| 0: [AssignExpr] ...=...
|
||||
# 0| 0: [VarAccess] result
|
||||
# 0| 1: [MethodAccess] plus(...)
|
||||
# 0| -1: [MethodAccess] times(...)
|
||||
# 0| -1: [VarAccess] result
|
||||
# 0| 0: [IntegerLiteral] 31
|
||||
# 0| 0: [MethodAccess] hashCode(...)
|
||||
# 0| -1: [TypeAccess] Arrays
|
||||
# 0| 0: [VarAccess] this.strs
|
||||
# 0| -1: [ThisAccess] this
|
||||
# 0| 2: [ReturnStmt] return ...
|
||||
# 0| 0: [VarAccess] result
|
||||
# 0| 6: [Method] toString
|
||||
# 0| 3: [TypeAccess] String
|
||||
# 0| 5: [BlockStmt] { ... }
|
||||
# 0| 0: [ReturnStmt] return ...
|
||||
# 0| 0: [StringTemplateExpr] "..."
|
||||
# 0| 0: [StringLiteral] ProtoMapValue(
|
||||
# 0| 1: [StringLiteral] bytes=
|
||||
# 0| 2: [MethodAccess] toString(...)
|
||||
# 0| -1: [TypeAccess] Arrays
|
||||
# 0| 0: [VarAccess] this.bytes
|
||||
# 0| -1: [ThisAccess] this
|
||||
# 0| 3: [StringLiteral] ,
|
||||
# 0| 4: [StringLiteral] strs=
|
||||
# 0| 5: [MethodAccess] toString(...)
|
||||
# 0| -1: [TypeAccess] Arrays
|
||||
# 0| 0: [VarAccess] this.strs
|
||||
# 0| -1: [ThisAccess] this
|
||||
# 0| 6: [StringLiteral] )
|
||||
# 1| 7: [Constructor] ProtoMapValue
|
||||
#-----| 4: (Parameters)
|
||||
# 1| 0: [Parameter] bytes
|
||||
@@ -133,23 +133,23 @@ dc.kt:
|
||||
# 1| 1: [ExprStmt] <Expr>;
|
||||
# 1| 0: [KtInitializerAssignExpr] ...=...
|
||||
# 1| 0: [VarAccess] strs
|
||||
# 1| 8: [Method] getBytes
|
||||
# 1| 8: [FieldDeclaration] byte[] bytes;
|
||||
# 1| -1: [TypeAccess] byte[]
|
||||
# 1| 0: [VarAccess] bytes
|
||||
# 1| 9: [Method] getBytes
|
||||
# 1| 3: [TypeAccess] byte[]
|
||||
# 1| 5: [BlockStmt] { ... }
|
||||
# 1| 0: [ReturnStmt] return ...
|
||||
# 1| 0: [VarAccess] this.bytes
|
||||
# 1| -1: [ThisAccess] this
|
||||
# 1| 8: [FieldDeclaration] byte[] bytes;
|
||||
# 1| -1: [TypeAccess] byte[]
|
||||
# 1| 0: [VarAccess] bytes
|
||||
# 1| 10: [Method] getStrs
|
||||
# 1| 10: [FieldDeclaration] String[] strs;
|
||||
# 1| -1: [TypeAccess] String[]
|
||||
# 1| 0: [TypeAccess] String
|
||||
# 1| 0: [VarAccess] strs
|
||||
# 1| 11: [Method] getStrs
|
||||
# 1| 3: [TypeAccess] String[]
|
||||
# 1| 0: [TypeAccess] String
|
||||
# 1| 5: [BlockStmt] { ... }
|
||||
# 1| 0: [ReturnStmt] return ...
|
||||
# 1| 0: [VarAccess] this.strs
|
||||
# 1| -1: [ThisAccess] this
|
||||
# 1| 10: [FieldDeclaration] String[] strs;
|
||||
# 1| -1: [TypeAccess] String[]
|
||||
# 1| 0: [TypeAccess] String
|
||||
# 1| 0: [VarAccess] strs
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -34,7 +34,7 @@ A.kt:
|
||||
# 13| 0: [ReturnStmt] return ...
|
||||
# 13| 0: [VarAccess] this.prop
|
||||
# 13| -1: [ThisAccess] this
|
||||
# 13| 6: [FieldDeclaration] int prop;
|
||||
# 13| 7: [FieldDeclaration] int prop;
|
||||
# 13| -1: [TypeAccess] int
|
||||
# 13| 0: [MethodAccess] fn(...)
|
||||
# 13| -1: [ThisAccess] A.this
|
||||
@@ -74,14 +74,14 @@ A.kt:
|
||||
# 20| 0: [VarAccess] B.x
|
||||
# 20| -1: [TypeAccess] B
|
||||
# 23| 11: [Class] Enu
|
||||
# 0| 1: [Method] values
|
||||
# 0| 3: [TypeAccess] Enu[]
|
||||
# 0| 0: [TypeAccess] Enu
|
||||
# 0| 1: [Method] valueOf
|
||||
# 0| 2: [Method] valueOf
|
||||
# 0| 3: [TypeAccess] Enu
|
||||
#-----| 4: (Parameters)
|
||||
# 0| 0: [Parameter] value
|
||||
# 0| 0: [TypeAccess] String
|
||||
# 0| 3: [Method] values
|
||||
# 0| 3: [TypeAccess] Enu[]
|
||||
# 0| 0: [TypeAccess] Enu
|
||||
# 23| 4: [Constructor] Enu
|
||||
# 23| 5: [BlockStmt] { ... }
|
||||
# 23| 0: [ExprStmt] <Expr>;
|
||||
|
||||
@@ -98,15 +98,15 @@ generics.kt:
|
||||
# 13| 0: [ExprStmt] <Expr>;
|
||||
# 13| 0: [KtInitializerAssignExpr] ...=...
|
||||
# 13| 0: [VarAccess] t
|
||||
# 13| 2: [Method] getT
|
||||
# 13| 2: [FieldDeclaration] T t;
|
||||
# 13| -1: [TypeAccess] T
|
||||
# 13| 0: [VarAccess] t
|
||||
# 13| 3: [Method] getT
|
||||
# 13| 3: [TypeAccess] T
|
||||
# 13| 5: [BlockStmt] { ... }
|
||||
# 13| 0: [ReturnStmt] return ...
|
||||
# 13| 0: [VarAccess] this.t
|
||||
# 13| -1: [ThisAccess] this
|
||||
# 13| 2: [FieldDeclaration] T t;
|
||||
# 13| -1: [TypeAccess] T
|
||||
# 13| 0: [VarAccess] t
|
||||
# 14| 4: [Method] f1
|
||||
# 14| 3: [TypeAccess] Unit
|
||||
#-----| 4: (Parameters)
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
public class JavaUser {
|
||||
|
||||
public static void test() {
|
||||
|
||||
HasCompanion.staticMethod("1");
|
||||
HasCompanion.Companion.nonStaticMethod("2");
|
||||
HasCompanion.setStaticProp(HasCompanion.Companion.getNonStaticProp());
|
||||
HasCompanion.Companion.setNonStaticProp(HasCompanion.getStaticProp());
|
||||
HasCompanion.Companion.setPropWithStaticGetter(HasCompanion.Companion.getPropWithStaticSetter());
|
||||
HasCompanion.setPropWithStaticSetter(HasCompanion.getPropWithStaticGetter());
|
||||
|
||||
// These extract as static methods, since there is no proxy method in the non-companion object case.
|
||||
NonCompanion.staticMethod("1");
|
||||
NonCompanion.INSTANCE.nonStaticMethod("2");
|
||||
NonCompanion.setStaticProp(NonCompanion.INSTANCE.getNonStaticProp());
|
||||
NonCompanion.INSTANCE.setNonStaticProp(NonCompanion.getStaticProp());
|
||||
NonCompanion.INSTANCE.setPropWithStaticGetter(NonCompanion.INSTANCE.getPropWithStaticSetter());
|
||||
NonCompanion.setPropWithStaticSetter(NonCompanion.getPropWithStaticGetter());
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,441 @@
|
||||
JavaUser.java:
|
||||
# 0| [CompilationUnit] JavaUser
|
||||
# 1| 1: [Class] JavaUser
|
||||
# 3| 2: [Method] test
|
||||
# 3| 3: [TypeAccess] void
|
||||
# 3| 5: [BlockStmt] { ... }
|
||||
# 5| 0: [ExprStmt] <Expr>;
|
||||
# 5| 0: [MethodAccess] staticMethod(...)
|
||||
# 5| -1: [TypeAccess] HasCompanion
|
||||
# 5| 0: [StringLiteral] "1"
|
||||
# 6| 1: [ExprStmt] <Expr>;
|
||||
# 6| 0: [MethodAccess] nonStaticMethod(...)
|
||||
# 6| -1: [VarAccess] HasCompanion.Companion
|
||||
# 6| -1: [TypeAccess] HasCompanion
|
||||
# 6| 0: [StringLiteral] "2"
|
||||
# 7| 2: [ExprStmt] <Expr>;
|
||||
# 7| 0: [MethodAccess] setStaticProp(...)
|
||||
# 7| -1: [TypeAccess] HasCompanion
|
||||
# 7| 0: [MethodAccess] getNonStaticProp(...)
|
||||
# 7| -1: [VarAccess] HasCompanion.Companion
|
||||
# 7| -1: [TypeAccess] HasCompanion
|
||||
# 8| 3: [ExprStmt] <Expr>;
|
||||
# 8| 0: [MethodAccess] setNonStaticProp(...)
|
||||
# 8| -1: [VarAccess] HasCompanion.Companion
|
||||
# 8| -1: [TypeAccess] HasCompanion
|
||||
# 8| 0: [MethodAccess] getStaticProp(...)
|
||||
# 8| -1: [TypeAccess] HasCompanion
|
||||
# 9| 4: [ExprStmt] <Expr>;
|
||||
# 9| 0: [MethodAccess] setPropWithStaticGetter(...)
|
||||
# 9| -1: [VarAccess] HasCompanion.Companion
|
||||
# 9| -1: [TypeAccess] HasCompanion
|
||||
# 9| 0: [MethodAccess] getPropWithStaticSetter(...)
|
||||
# 9| -1: [VarAccess] HasCompanion.Companion
|
||||
# 9| -1: [TypeAccess] HasCompanion
|
||||
# 10| 5: [ExprStmt] <Expr>;
|
||||
# 10| 0: [MethodAccess] setPropWithStaticSetter(...)
|
||||
# 10| -1: [TypeAccess] HasCompanion
|
||||
# 10| 0: [MethodAccess] getPropWithStaticGetter(...)
|
||||
# 10| -1: [TypeAccess] HasCompanion
|
||||
# 13| 6: [ExprStmt] <Expr>;
|
||||
# 13| 0: [MethodAccess] staticMethod(...)
|
||||
# 13| -1: [TypeAccess] NonCompanion
|
||||
# 13| 0: [StringLiteral] "1"
|
||||
# 14| 7: [ExprStmt] <Expr>;
|
||||
# 14| 0: [MethodAccess] nonStaticMethod(...)
|
||||
# 14| -1: [VarAccess] NonCompanion.INSTANCE
|
||||
# 14| -1: [TypeAccess] NonCompanion
|
||||
# 14| 0: [StringLiteral] "2"
|
||||
# 15| 8: [ExprStmt] <Expr>;
|
||||
# 15| 0: [MethodAccess] setStaticProp(...)
|
||||
# 15| -1: [TypeAccess] NonCompanion
|
||||
# 15| 0: [MethodAccess] getNonStaticProp(...)
|
||||
# 15| -1: [VarAccess] NonCompanion.INSTANCE
|
||||
# 15| -1: [TypeAccess] NonCompanion
|
||||
# 16| 9: [ExprStmt] <Expr>;
|
||||
# 16| 0: [MethodAccess] setNonStaticProp(...)
|
||||
# 16| -1: [VarAccess] NonCompanion.INSTANCE
|
||||
# 16| -1: [TypeAccess] NonCompanion
|
||||
# 16| 0: [MethodAccess] getStaticProp(...)
|
||||
# 16| -1: [TypeAccess] NonCompanion
|
||||
# 17| 10: [ExprStmt] <Expr>;
|
||||
# 17| 0: [MethodAccess] setPropWithStaticGetter(...)
|
||||
# 17| -1: [VarAccess] NonCompanion.INSTANCE
|
||||
# 17| -1: [TypeAccess] NonCompanion
|
||||
# 17| 0: [MethodAccess] getPropWithStaticSetter(...)
|
||||
# 17| -1: [VarAccess] NonCompanion.INSTANCE
|
||||
# 17| -1: [TypeAccess] NonCompanion
|
||||
# 18| 11: [ExprStmt] <Expr>;
|
||||
# 18| 0: [MethodAccess] setPropWithStaticSetter(...)
|
||||
# 18| -1: [TypeAccess] NonCompanion
|
||||
# 18| 0: [MethodAccess] getPropWithStaticGetter(...)
|
||||
# 18| -1: [TypeAccess] NonCompanion
|
||||
test.kt:
|
||||
# 0| [CompilationUnit] test
|
||||
# 0| 1: [Class] TestKt
|
||||
# 49| 1: [Method] externalUser
|
||||
# 49| 3: [TypeAccess] Unit
|
||||
# 49| 5: [BlockStmt] { ... }
|
||||
# 52| 0: [ExprStmt] <Expr>;
|
||||
# 52| 0: [ImplicitCoercionToUnitExpr] <implicit coercion to unit>
|
||||
# 52| 0: [TypeAccess] Unit
|
||||
# 52| 1: [MethodAccess] staticMethod(...)
|
||||
# 52| -1: [VarAccess] Companion
|
||||
# 52| 0: [StringLiteral] 1
|
||||
# 53| 1: [ExprStmt] <Expr>;
|
||||
# 53| 0: [ImplicitCoercionToUnitExpr] <implicit coercion to unit>
|
||||
# 53| 0: [TypeAccess] Unit
|
||||
# 53| 1: [MethodAccess] nonStaticMethod(...)
|
||||
# 53| -1: [VarAccess] Companion
|
||||
# 53| 0: [StringLiteral] 2
|
||||
# 54| 2: [ExprStmt] <Expr>;
|
||||
# 54| 0: [MethodAccess] setStaticProp(...)
|
||||
# 54| -1: [VarAccess] Companion
|
||||
# 54| 0: [MethodAccess] getNonStaticProp(...)
|
||||
# 54| -1: [VarAccess] Companion
|
||||
# 55| 3: [ExprStmt] <Expr>;
|
||||
# 55| 0: [MethodAccess] setNonStaticProp(...)
|
||||
# 55| -1: [VarAccess] Companion
|
||||
# 55| 0: [MethodAccess] getStaticProp(...)
|
||||
# 55| -1: [VarAccess] Companion
|
||||
# 56| 4: [ExprStmt] <Expr>;
|
||||
# 56| 0: [MethodAccess] setPropWithStaticGetter(...)
|
||||
# 56| -1: [VarAccess] Companion
|
||||
# 56| 0: [MethodAccess] getPropWithStaticSetter(...)
|
||||
# 56| -1: [VarAccess] Companion
|
||||
# 57| 5: [ExprStmt] <Expr>;
|
||||
# 57| 0: [MethodAccess] setPropWithStaticSetter(...)
|
||||
# 57| -1: [VarAccess] Companion
|
||||
# 57| 0: [MethodAccess] getPropWithStaticGetter(...)
|
||||
# 57| -1: [VarAccess] Companion
|
||||
# 60| 6: [ExprStmt] <Expr>;
|
||||
# 60| 0: [ImplicitCoercionToUnitExpr] <implicit coercion to unit>
|
||||
# 60| 0: [TypeAccess] Unit
|
||||
# 60| 1: [MethodAccess] staticMethod(...)
|
||||
# 60| -1: [TypeAccess] NonCompanion
|
||||
# 60| 0: [StringLiteral] 1
|
||||
# 61| 7: [ExprStmt] <Expr>;
|
||||
# 61| 0: [ImplicitCoercionToUnitExpr] <implicit coercion to unit>
|
||||
# 61| 0: [TypeAccess] Unit
|
||||
# 61| 1: [MethodAccess] nonStaticMethod(...)
|
||||
# 61| -1: [VarAccess] INSTANCE
|
||||
# 61| 0: [StringLiteral] 2
|
||||
# 62| 8: [ExprStmt] <Expr>;
|
||||
# 62| 0: [MethodAccess] setStaticProp(...)
|
||||
# 62| -1: [TypeAccess] NonCompanion
|
||||
# 62| 0: [MethodAccess] getNonStaticProp(...)
|
||||
# 62| -1: [VarAccess] INSTANCE
|
||||
# 63| 9: [ExprStmt] <Expr>;
|
||||
# 63| 0: [MethodAccess] setNonStaticProp(...)
|
||||
# 63| -1: [VarAccess] INSTANCE
|
||||
# 63| 0: [MethodAccess] getStaticProp(...)
|
||||
# 63| -1: [TypeAccess] NonCompanion
|
||||
# 64| 10: [ExprStmt] <Expr>;
|
||||
# 64| 0: [MethodAccess] setPropWithStaticGetter(...)
|
||||
# 64| -1: [VarAccess] INSTANCE
|
||||
# 64| 0: [MethodAccess] getPropWithStaticSetter(...)
|
||||
# 64| -1: [VarAccess] INSTANCE
|
||||
# 65| 11: [ExprStmt] <Expr>;
|
||||
# 65| 0: [MethodAccess] setPropWithStaticSetter(...)
|
||||
# 65| -1: [TypeAccess] NonCompanion
|
||||
# 65| 0: [MethodAccess] getPropWithStaticGetter(...)
|
||||
# 65| -1: [TypeAccess] NonCompanion
|
||||
# 9| 2: [Class] HasCompanion
|
||||
#-----| -3: (Annotations)
|
||||
# 9| 2: [Constructor] HasCompanion
|
||||
# 9| 5: [BlockStmt] { ... }
|
||||
# 9| 0: [SuperConstructorInvocationStmt] super(...)
|
||||
# 9| 1: [BlockStmt] { ... }
|
||||
# 11| 3: [Class] Companion
|
||||
#-----| -3: (Annotations)
|
||||
# 11| 1: [Constructor] Companion
|
||||
# 11| 5: [BlockStmt] { ... }
|
||||
# 11| 0: [SuperConstructorInvocationStmt] super(...)
|
||||
# 11| 1: [BlockStmt] { ... }
|
||||
# 16| 0: [ExprStmt] <Expr>;
|
||||
# 16| 0: [KtInitializerAssignExpr] ...=...
|
||||
# 16| 0: [VarAccess] staticProp
|
||||
# 17| 1: [ExprStmt] <Expr>;
|
||||
# 17| 0: [KtInitializerAssignExpr] ...=...
|
||||
# 17| 0: [VarAccess] nonStaticProp
|
||||
# 13| 2: [Method] staticMethod
|
||||
#-----| 1: (Annotations)
|
||||
# 13| 3: [TypeAccess] String
|
||||
#-----| 4: (Parameters)
|
||||
# 13| 0: [Parameter] s
|
||||
#-----| -1: (Annotations)
|
||||
# 13| 0: [TypeAccess] String
|
||||
# 13| 5: [BlockStmt] { ... }
|
||||
# 13| 0: [ReturnStmt] return ...
|
||||
# 13| 0: [MethodAccess] nonStaticMethod(...)
|
||||
# 13| -1: [ThisAccess] this
|
||||
# 13| 0: [VarAccess] s
|
||||
# 14| 3: [Method] nonStaticMethod
|
||||
#-----| 1: (Annotations)
|
||||
# 14| 3: [TypeAccess] String
|
||||
#-----| 4: (Parameters)
|
||||
# 14| 0: [Parameter] s
|
||||
#-----| -1: (Annotations)
|
||||
# 14| 0: [TypeAccess] String
|
||||
# 14| 5: [BlockStmt] { ... }
|
||||
# 14| 0: [ReturnStmt] return ...
|
||||
# 14| 0: [MethodAccess] staticMethod(...)
|
||||
# 14| -1: [ThisAccess] this
|
||||
# 14| 0: [VarAccess] s
|
||||
# 16| 4: [FieldDeclaration] String staticProp;
|
||||
# 16| -1: [TypeAccess] String
|
||||
# 16| 0: [StringLiteral] a
|
||||
# 16| 5: [Method] getStaticProp
|
||||
#-----| 1: (Annotations)
|
||||
# 16| 3: [TypeAccess] String
|
||||
# 16| 5: [BlockStmt] { ... }
|
||||
# 16| 0: [ReturnStmt] return ...
|
||||
# 16| 0: [VarAccess] this.staticProp
|
||||
# 16| -1: [ThisAccess] this
|
||||
# 16| 6: [Method] setStaticProp
|
||||
# 16| 3: [TypeAccess] Unit
|
||||
#-----| 4: (Parameters)
|
||||
# 16| 0: [Parameter] <set-?>
|
||||
#-----| -1: (Annotations)
|
||||
# 16| 0: [TypeAccess] String
|
||||
# 16| 5: [BlockStmt] { ... }
|
||||
# 16| 0: [ExprStmt] <Expr>;
|
||||
# 16| 0: [AssignExpr] ...=...
|
||||
# 16| 0: [VarAccess] this.staticProp
|
||||
# 16| -1: [ThisAccess] this
|
||||
# 16| 1: [VarAccess] <set-?>
|
||||
# 17| 7: [FieldDeclaration] String nonStaticProp;
|
||||
# 17| -1: [TypeAccess] String
|
||||
# 17| 0: [StringLiteral] b
|
||||
# 17| 8: [Method] getNonStaticProp
|
||||
#-----| 1: (Annotations)
|
||||
# 17| 3: [TypeAccess] String
|
||||
# 17| 5: [BlockStmt] { ... }
|
||||
# 17| 0: [ReturnStmt] return ...
|
||||
# 17| 0: [VarAccess] this.nonStaticProp
|
||||
# 17| -1: [ThisAccess] this
|
||||
# 17| 9: [Method] setNonStaticProp
|
||||
# 17| 3: [TypeAccess] Unit
|
||||
#-----| 4: (Parameters)
|
||||
# 17| 0: [Parameter] <set-?>
|
||||
#-----| -1: (Annotations)
|
||||
# 17| 0: [TypeAccess] String
|
||||
# 17| 5: [BlockStmt] { ... }
|
||||
# 17| 0: [ExprStmt] <Expr>;
|
||||
# 17| 0: [AssignExpr] ...=...
|
||||
# 17| 0: [VarAccess] this.nonStaticProp
|
||||
# 17| -1: [ThisAccess] this
|
||||
# 17| 1: [VarAccess] <set-?>
|
||||
# 20| 10: [Method] getPropWithStaticGetter
|
||||
#-----| 1: (Annotations)
|
||||
# 20| 3: [TypeAccess] String
|
||||
# 20| 5: [BlockStmt] { ... }
|
||||
# 20| 0: [ReturnStmt] return ...
|
||||
# 20| 0: [MethodAccess] getPropWithStaticSetter(...)
|
||||
# 20| -1: [ThisAccess] this
|
||||
# 21| 11: [Method] setPropWithStaticGetter
|
||||
# 21| 3: [TypeAccess] Unit
|
||||
#-----| 4: (Parameters)
|
||||
# 21| 0: [Parameter] s
|
||||
#-----| -1: (Annotations)
|
||||
# 21| 0: [TypeAccess] String
|
||||
# 21| 5: [BlockStmt] { ... }
|
||||
# 21| 0: [ExprStmt] <Expr>;
|
||||
# 21| 0: [MethodAccess] setPropWithStaticSetter(...)
|
||||
# 21| -1: [ThisAccess] this
|
||||
# 21| 0: [VarAccess] s
|
||||
# 24| 12: [Method] getPropWithStaticSetter
|
||||
#-----| 1: (Annotations)
|
||||
# 24| 3: [TypeAccess] String
|
||||
# 24| 5: [BlockStmt] { ... }
|
||||
# 24| 0: [ReturnStmt] return ...
|
||||
# 24| 0: [MethodAccess] getPropWithStaticGetter(...)
|
||||
# 24| -1: [ThisAccess] this
|
||||
# 25| 13: [Method] setPropWithStaticSetter
|
||||
#-----| 1: (Annotations)
|
||||
# 25| 3: [TypeAccess] Unit
|
||||
#-----| 4: (Parameters)
|
||||
# 25| 0: [Parameter] s
|
||||
#-----| -1: (Annotations)
|
||||
# 25| 0: [TypeAccess] String
|
||||
# 25| 5: [BlockStmt] { ... }
|
||||
# 25| 0: [ExprStmt] <Expr>;
|
||||
# 25| 0: [MethodAccess] setPropWithStaticGetter(...)
|
||||
# 25| -1: [ThisAccess] this
|
||||
# 25| 0: [VarAccess] s
|
||||
# 13| 4: [Method] staticMethod
|
||||
#-----| 1: (Annotations)
|
||||
# 13| 3: [TypeAccess] String
|
||||
#-----| 4: (Parameters)
|
||||
# 13| 0: [Parameter] s
|
||||
#-----| -1: (Annotations)
|
||||
# 13| 0: [TypeAccess] String
|
||||
# 13| 5: [BlockStmt] { ... }
|
||||
# 13| 0: [ReturnStmt] return ...
|
||||
# 13| 0: [MethodAccess] staticMethod(...)
|
||||
# 13| -1: [VarAccess] HasCompanion.Companion
|
||||
# 13| -1: [TypeAccess] HasCompanion
|
||||
# 13| 0: [VarAccess] s
|
||||
# 16| 5: [Method] getStaticProp
|
||||
#-----| 1: (Annotations)
|
||||
# 16| 3: [TypeAccess] String
|
||||
# 16| 5: [BlockStmt] { ... }
|
||||
# 16| 0: [ReturnStmt] return ...
|
||||
# 16| 0: [MethodAccess] getStaticProp(...)
|
||||
# 16| -1: [VarAccess] HasCompanion.Companion
|
||||
# 16| -1: [TypeAccess] HasCompanion
|
||||
# 16| 6: [Method] setStaticProp
|
||||
# 16| 3: [TypeAccess] Unit
|
||||
#-----| 4: (Parameters)
|
||||
# 16| 0: [Parameter] <set-?>
|
||||
#-----| -1: (Annotations)
|
||||
# 16| 0: [TypeAccess] String
|
||||
# 16| 5: [BlockStmt] { ... }
|
||||
# 16| 0: [ReturnStmt] return ...
|
||||
# 16| 0: [MethodAccess] setStaticProp(...)
|
||||
# 16| -1: [VarAccess] HasCompanion.Companion
|
||||
# 16| -1: [TypeAccess] HasCompanion
|
||||
# 16| 0: [VarAccess] <set-?>
|
||||
# 20| 7: [Method] getPropWithStaticGetter
|
||||
#-----| 1: (Annotations)
|
||||
# 20| 3: [TypeAccess] String
|
||||
# 20| 5: [BlockStmt] { ... }
|
||||
# 20| 0: [ReturnStmt] return ...
|
||||
# 20| 0: [MethodAccess] getPropWithStaticGetter(...)
|
||||
# 20| -1: [VarAccess] HasCompanion.Companion
|
||||
# 20| -1: [TypeAccess] HasCompanion
|
||||
# 25| 8: [Method] setPropWithStaticSetter
|
||||
#-----| 1: (Annotations)
|
||||
# 25| 3: [TypeAccess] Unit
|
||||
#-----| 4: (Parameters)
|
||||
# 25| 0: [Parameter] s
|
||||
#-----| -1: (Annotations)
|
||||
# 25| 0: [TypeAccess] String
|
||||
# 25| 5: [BlockStmt] { ... }
|
||||
# 25| 0: [ReturnStmt] return ...
|
||||
# 25| 0: [MethodAccess] setPropWithStaticSetter(...)
|
||||
# 25| -1: [VarAccess] HasCompanion.Companion
|
||||
# 25| -1: [TypeAccess] HasCompanion
|
||||
# 25| 0: [VarAccess] s
|
||||
# 31| 3: [Class] NonCompanion
|
||||
#-----| -3: (Annotations)
|
||||
# 31| 2: [Constructor] NonCompanion
|
||||
# 31| 5: [BlockStmt] { ... }
|
||||
# 31| 0: [SuperConstructorInvocationStmt] super(...)
|
||||
# 31| 1: [BlockStmt] { ... }
|
||||
# 36| 0: [ExprStmt] <Expr>;
|
||||
# 36| 0: [KtInitializerAssignExpr] ...=...
|
||||
# 36| 0: [VarAccess] staticProp
|
||||
# 37| 1: [ExprStmt] <Expr>;
|
||||
# 37| 0: [KtInitializerAssignExpr] ...=...
|
||||
# 37| 0: [VarAccess] nonStaticProp
|
||||
# 33| 3: [Method] staticMethod
|
||||
#-----| 1: (Annotations)
|
||||
# 33| 3: [TypeAccess] String
|
||||
#-----| 4: (Parameters)
|
||||
# 33| 0: [Parameter] s
|
||||
#-----| -1: (Annotations)
|
||||
# 33| 0: [TypeAccess] String
|
||||
# 33| 5: [BlockStmt] { ... }
|
||||
# 33| 0: [ReturnStmt] return ...
|
||||
# 33| 0: [MethodAccess] nonStaticMethod(...)
|
||||
# 33| -1: [VarAccess] NonCompanion.INSTANCE
|
||||
# 33| -1: [TypeAccess] NonCompanion
|
||||
# 33| 0: [VarAccess] s
|
||||
# 34| 4: [Method] nonStaticMethod
|
||||
#-----| 1: (Annotations)
|
||||
# 34| 3: [TypeAccess] String
|
||||
#-----| 4: (Parameters)
|
||||
# 34| 0: [Parameter] s
|
||||
#-----| -1: (Annotations)
|
||||
# 34| 0: [TypeAccess] String
|
||||
# 34| 5: [BlockStmt] { ... }
|
||||
# 34| 0: [ReturnStmt] return ...
|
||||
# 34| 0: [MethodAccess] staticMethod(...)
|
||||
# 34| -1: [TypeAccess] NonCompanion
|
||||
# 34| 0: [VarAccess] s
|
||||
# 36| 5: [FieldDeclaration] String staticProp;
|
||||
# 36| -1: [TypeAccess] String
|
||||
# 36| 0: [StringLiteral] a
|
||||
# 36| 6: [Method] getStaticProp
|
||||
#-----| 1: (Annotations)
|
||||
# 36| 3: [TypeAccess] String
|
||||
# 36| 5: [BlockStmt] { ... }
|
||||
# 36| 0: [ReturnStmt] return ...
|
||||
# 36| 0: [VarAccess] NonCompanion.INSTANCE.staticProp
|
||||
# 36| -1: [VarAccess] NonCompanion.INSTANCE
|
||||
# 36| -1: [TypeAccess] NonCompanion
|
||||
# 36| 7: [Method] setStaticProp
|
||||
# 36| 3: [TypeAccess] Unit
|
||||
#-----| 4: (Parameters)
|
||||
# 36| 0: [Parameter] <set-?>
|
||||
#-----| -1: (Annotations)
|
||||
# 36| 0: [TypeAccess] String
|
||||
# 36| 5: [BlockStmt] { ... }
|
||||
# 36| 0: [ExprStmt] <Expr>;
|
||||
# 36| 0: [AssignExpr] ...=...
|
||||
# 36| 0: [VarAccess] NonCompanion.INSTANCE.staticProp
|
||||
# 36| -1: [VarAccess] NonCompanion.INSTANCE
|
||||
# 36| -1: [TypeAccess] NonCompanion
|
||||
# 36| 1: [VarAccess] <set-?>
|
||||
# 37| 8: [FieldDeclaration] String nonStaticProp;
|
||||
# 37| -1: [TypeAccess] String
|
||||
# 37| 0: [StringLiteral] b
|
||||
# 37| 9: [Method] getNonStaticProp
|
||||
#-----| 1: (Annotations)
|
||||
# 37| 3: [TypeAccess] String
|
||||
# 37| 5: [BlockStmt] { ... }
|
||||
# 37| 0: [ReturnStmt] return ...
|
||||
# 37| 0: [VarAccess] this.nonStaticProp
|
||||
# 37| -1: [ThisAccess] this
|
||||
# 37| 10: [Method] setNonStaticProp
|
||||
# 37| 3: [TypeAccess] Unit
|
||||
#-----| 4: (Parameters)
|
||||
# 37| 0: [Parameter] <set-?>
|
||||
#-----| -1: (Annotations)
|
||||
# 37| 0: [TypeAccess] String
|
||||
# 37| 5: [BlockStmt] { ... }
|
||||
# 37| 0: [ExprStmt] <Expr>;
|
||||
# 37| 0: [AssignExpr] ...=...
|
||||
# 37| 0: [VarAccess] this.nonStaticProp
|
||||
# 37| -1: [ThisAccess] this
|
||||
# 37| 1: [VarAccess] <set-?>
|
||||
# 40| 11: [Method] getPropWithStaticGetter
|
||||
#-----| 1: (Annotations)
|
||||
# 40| 3: [TypeAccess] String
|
||||
# 40| 5: [BlockStmt] { ... }
|
||||
# 40| 0: [ReturnStmt] return ...
|
||||
# 40| 0: [MethodAccess] getPropWithStaticSetter(...)
|
||||
# 40| -1: [VarAccess] NonCompanion.INSTANCE
|
||||
# 40| -1: [TypeAccess] NonCompanion
|
||||
# 41| 12: [Method] setPropWithStaticGetter
|
||||
# 41| 3: [TypeAccess] Unit
|
||||
#-----| 4: (Parameters)
|
||||
# 41| 0: [Parameter] s
|
||||
#-----| -1: (Annotations)
|
||||
# 41| 0: [TypeAccess] String
|
||||
# 41| 5: [BlockStmt] { ... }
|
||||
# 41| 0: [ExprStmt] <Expr>;
|
||||
# 41| 0: [MethodAccess] setPropWithStaticSetter(...)
|
||||
# 41| -1: [TypeAccess] NonCompanion
|
||||
# 41| 0: [VarAccess] s
|
||||
# 44| 13: [Method] getPropWithStaticSetter
|
||||
#-----| 1: (Annotations)
|
||||
# 44| 3: [TypeAccess] String
|
||||
# 44| 5: [BlockStmt] { ... }
|
||||
# 44| 0: [ReturnStmt] return ...
|
||||
# 44| 0: [MethodAccess] getPropWithStaticGetter(...)
|
||||
# 44| -1: [TypeAccess] NonCompanion
|
||||
# 45| 14: [Method] setPropWithStaticSetter
|
||||
#-----| 1: (Annotations)
|
||||
# 45| 3: [TypeAccess] Unit
|
||||
#-----| 4: (Parameters)
|
||||
# 45| 0: [Parameter] s
|
||||
#-----| -1: (Annotations)
|
||||
# 45| 0: [TypeAccess] String
|
||||
# 45| 5: [BlockStmt] { ... }
|
||||
# 45| 0: [ExprStmt] <Expr>;
|
||||
# 45| 0: [MethodAccess] setPropWithStaticGetter(...)
|
||||
# 45| -1: [VarAccess] NonCompanion.INSTANCE
|
||||
# 45| -1: [TypeAccess] NonCompanion
|
||||
# 45| 0: [VarAccess] s
|
||||
@@ -0,0 +1 @@
|
||||
semmle/code/java/PrintAst.ql
|
||||
@@ -0,0 +1,74 @@
|
||||
staticMembers
|
||||
| JavaUser.java:1:14:1:21 | JavaUser | JavaUser.java:3:22:3:25 | test | Method |
|
||||
| test.kt:0:0:0:0 | TestKt | test.kt:49:1:67:1 | externalUser | Method |
|
||||
| test.kt:9:1:29:1 | HasCompanion | test.kt:11:3:27:3 | Companion | Class |
|
||||
| test.kt:9:1:29:1 | HasCompanion | test.kt:11:3:27:3 | Companion | Field |
|
||||
| test.kt:9:1:29:1 | HasCompanion | test.kt:13:16:13:71 | staticMethod | Method |
|
||||
| test.kt:9:1:29:1 | HasCompanion | test.kt:16:16:16:43 | getStaticProp | Method |
|
||||
| test.kt:9:1:29:1 | HasCompanion | test.kt:16:16:16:43 | setStaticProp | Method |
|
||||
| test.kt:9:1:29:1 | HasCompanion | test.kt:20:18:20:45 | getPropWithStaticGetter | Method |
|
||||
| test.kt:9:1:29:1 | HasCompanion | test.kt:25:18:25:60 | setPropWithStaticSetter | Method |
|
||||
| test.kt:31:1:47:1 | NonCompanion | test.kt:31:1:47:1 | INSTANCE | Field |
|
||||
| test.kt:31:1:47:1 | NonCompanion | test.kt:33:14:33:69 | staticMethod | Method |
|
||||
| test.kt:31:1:47:1 | NonCompanion | test.kt:36:14:36:41 | getStaticProp | Method |
|
||||
| test.kt:31:1:47:1 | NonCompanion | test.kt:36:14:36:41 | setStaticProp | Method |
|
||||
| test.kt:31:1:47:1 | NonCompanion | test.kt:40:16:40:43 | getPropWithStaticGetter | Method |
|
||||
| test.kt:31:1:47:1 | NonCompanion | test.kt:45:16:45:58 | setPropWithStaticSetter | Method |
|
||||
#select
|
||||
| test.kt:9:1:29:1 | HasCompanion | JavaUser.java:5:5:5:34 | staticMethod(...) | JavaUser.java:5:5:5:16 | HasCompanion | static |
|
||||
| test.kt:9:1:29:1 | HasCompanion | JavaUser.java:7:5:7:73 | setStaticProp(...) | JavaUser.java:7:5:7:16 | HasCompanion | static |
|
||||
| test.kt:9:1:29:1 | HasCompanion | JavaUser.java:8:45:8:72 | getStaticProp(...) | JavaUser.java:8:45:8:56 | HasCompanion | static |
|
||||
| test.kt:9:1:29:1 | HasCompanion | JavaUser.java:10:5:10:80 | setPropWithStaticSetter(...) | JavaUser.java:10:5:10:16 | HasCompanion | static |
|
||||
| test.kt:9:1:29:1 | HasCompanion | JavaUser.java:10:42:10:79 | getPropWithStaticGetter(...) | JavaUser.java:10:42:10:53 | HasCompanion | static |
|
||||
| test.kt:11:3:27:3 | Companion | JavaUser.java:6:5:6:47 | nonStaticMethod(...) | JavaUser.java:6:5:6:26 | HasCompanion.Companion | instance |
|
||||
| test.kt:11:3:27:3 | Companion | JavaUser.java:7:32:7:72 | getNonStaticProp(...) | JavaUser.java:7:32:7:53 | HasCompanion.Companion | instance |
|
||||
| test.kt:11:3:27:3 | Companion | JavaUser.java:8:5:8:73 | setNonStaticProp(...) | JavaUser.java:8:5:8:26 | HasCompanion.Companion | instance |
|
||||
| test.kt:11:3:27:3 | Companion | JavaUser.java:9:5:9:100 | setPropWithStaticGetter(...) | JavaUser.java:9:5:9:26 | HasCompanion.Companion | instance |
|
||||
| test.kt:11:3:27:3 | Companion | JavaUser.java:9:52:9:99 | getPropWithStaticSetter(...) | JavaUser.java:9:52:9:73 | HasCompanion.Companion | instance |
|
||||
| test.kt:11:3:27:3 | Companion | test.kt:13:16:13:71 | staticMethod(...) | test.kt:13:16:13:71 | HasCompanion.Companion | instance |
|
||||
| test.kt:11:3:27:3 | Companion | test.kt:13:54:13:71 | nonStaticMethod(...) | test.kt:13:54:13:71 | this | instance |
|
||||
| test.kt:11:3:27:3 | Companion | test.kt:14:46:14:60 | staticMethod(...) | test.kt:14:46:14:60 | this | instance |
|
||||
| test.kt:11:3:27:3 | Companion | test.kt:16:16:16:43 | getStaticProp(...) | test.kt:16:16:16:43 | HasCompanion.Companion | instance |
|
||||
| test.kt:11:3:27:3 | Companion | test.kt:16:16:16:43 | setStaticProp(...) | test.kt:16:16:16:43 | HasCompanion.Companion | instance |
|
||||
| test.kt:11:3:27:3 | Companion | test.kt:20:18:20:45 | getPropWithStaticGetter(...) | test.kt:20:18:20:45 | HasCompanion.Companion | instance |
|
||||
| test.kt:11:3:27:3 | Companion | test.kt:20:26:20:45 | getPropWithStaticSetter(...) | test.kt:20:26:20:45 | this | instance |
|
||||
| test.kt:11:3:27:3 | Companion | test.kt:21:24:21:43 | setPropWithStaticSetter(...) | test.kt:21:24:21:43 | this | instance |
|
||||
| test.kt:11:3:27:3 | Companion | test.kt:24:15:24:34 | getPropWithStaticGetter(...) | test.kt:24:15:24:34 | this | instance |
|
||||
| test.kt:11:3:27:3 | Companion | test.kt:25:18:25:60 | setPropWithStaticSetter(...) | test.kt:25:18:25:60 | HasCompanion.Companion | instance |
|
||||
| test.kt:11:3:27:3 | Companion | test.kt:25:35:25:54 | setPropWithStaticGetter(...) | test.kt:25:35:25:54 | this | instance |
|
||||
| test.kt:11:3:27:3 | Companion | test.kt:52:16:52:32 | staticMethod(...) | test.kt:52:3:52:14 | Companion | instance |
|
||||
| test.kt:11:3:27:3 | Companion | test.kt:53:16:53:35 | nonStaticMethod(...) | test.kt:53:3:53:14 | Companion | instance |
|
||||
| test.kt:11:3:27:3 | Companion | test.kt:54:3:54:25 | setStaticProp(...) | test.kt:54:3:54:14 | Companion | instance |
|
||||
| test.kt:11:3:27:3 | Companion | test.kt:54:42:54:54 | getNonStaticProp(...) | test.kt:54:29:54:40 | Companion | instance |
|
||||
| test.kt:11:3:27:3 | Companion | test.kt:55:3:55:28 | setNonStaticProp(...) | test.kt:55:3:55:14 | Companion | instance |
|
||||
| test.kt:11:3:27:3 | Companion | test.kt:55:45:55:54 | getStaticProp(...) | test.kt:55:32:55:43 | Companion | instance |
|
||||
| test.kt:11:3:27:3 | Companion | test.kt:56:3:56:35 | setPropWithStaticGetter(...) | test.kt:56:3:56:14 | Companion | instance |
|
||||
| test.kt:11:3:27:3 | Companion | test.kt:56:52:56:71 | getPropWithStaticSetter(...) | test.kt:56:39:56:50 | Companion | instance |
|
||||
| test.kt:11:3:27:3 | Companion | test.kt:57:3:57:35 | setPropWithStaticSetter(...) | test.kt:57:3:57:14 | Companion | instance |
|
||||
| test.kt:11:3:27:3 | Companion | test.kt:57:52:57:71 | getPropWithStaticGetter(...) | test.kt:57:39:57:50 | Companion | instance |
|
||||
| test.kt:31:1:47:1 | NonCompanion | JavaUser.java:13:5:13:34 | staticMethod(...) | JavaUser.java:13:5:13:16 | NonCompanion | static |
|
||||
| test.kt:31:1:47:1 | NonCompanion | JavaUser.java:14:5:14:46 | nonStaticMethod(...) | JavaUser.java:14:5:14:25 | NonCompanion.INSTANCE | instance |
|
||||
| test.kt:31:1:47:1 | NonCompanion | JavaUser.java:15:5:15:72 | setStaticProp(...) | JavaUser.java:15:5:15:16 | NonCompanion | static |
|
||||
| test.kt:31:1:47:1 | NonCompanion | JavaUser.java:15:32:15:71 | getNonStaticProp(...) | JavaUser.java:15:32:15:52 | NonCompanion.INSTANCE | instance |
|
||||
| test.kt:31:1:47:1 | NonCompanion | JavaUser.java:16:5:16:72 | setNonStaticProp(...) | JavaUser.java:16:5:16:25 | NonCompanion.INSTANCE | instance |
|
||||
| test.kt:31:1:47:1 | NonCompanion | JavaUser.java:16:44:16:71 | getStaticProp(...) | JavaUser.java:16:44:16:55 | NonCompanion | static |
|
||||
| test.kt:31:1:47:1 | NonCompanion | JavaUser.java:17:5:17:98 | setPropWithStaticGetter(...) | JavaUser.java:17:5:17:25 | NonCompanion.INSTANCE | instance |
|
||||
| test.kt:31:1:47:1 | NonCompanion | JavaUser.java:17:51:17:97 | getPropWithStaticSetter(...) | JavaUser.java:17:51:17:71 | NonCompanion.INSTANCE | instance |
|
||||
| test.kt:31:1:47:1 | NonCompanion | JavaUser.java:18:5:18:80 | setPropWithStaticSetter(...) | JavaUser.java:18:5:18:16 | NonCompanion | static |
|
||||
| test.kt:31:1:47:1 | NonCompanion | JavaUser.java:18:42:18:79 | getPropWithStaticGetter(...) | JavaUser.java:18:42:18:53 | NonCompanion | static |
|
||||
| test.kt:31:1:47:1 | NonCompanion | test.kt:33:52:33:69 | nonStaticMethod(...) | test.kt:33:52:33:69 | NonCompanion.INSTANCE | instance |
|
||||
| test.kt:31:1:47:1 | NonCompanion | test.kt:34:44:34:58 | staticMethod(...) | test.kt:34:44:34:58 | NonCompanion | static |
|
||||
| test.kt:31:1:47:1 | NonCompanion | test.kt:40:24:40:43 | getPropWithStaticSetter(...) | test.kt:40:24:40:43 | NonCompanion.INSTANCE | instance |
|
||||
| test.kt:31:1:47:1 | NonCompanion | test.kt:41:22:41:41 | setPropWithStaticSetter(...) | test.kt:41:22:41:41 | NonCompanion | static |
|
||||
| test.kt:31:1:47:1 | NonCompanion | test.kt:44:13:44:32 | getPropWithStaticGetter(...) | test.kt:44:13:44:32 | NonCompanion | static |
|
||||
| test.kt:31:1:47:1 | NonCompanion | test.kt:45:33:45:52 | setPropWithStaticGetter(...) | test.kt:45:33:45:52 | NonCompanion.INSTANCE | instance |
|
||||
| test.kt:31:1:47:1 | NonCompanion | test.kt:60:16:60:32 | staticMethod(...) | test.kt:60:16:60:32 | NonCompanion | static |
|
||||
| test.kt:31:1:47:1 | NonCompanion | test.kt:61:16:61:35 | nonStaticMethod(...) | test.kt:61:3:61:14 | INSTANCE | instance |
|
||||
| test.kt:31:1:47:1 | NonCompanion | test.kt:62:3:62:25 | setStaticProp(...) | test.kt:62:3:62:25 | NonCompanion | static |
|
||||
| test.kt:31:1:47:1 | NonCompanion | test.kt:62:42:62:54 | getNonStaticProp(...) | test.kt:62:29:62:40 | INSTANCE | instance |
|
||||
| test.kt:31:1:47:1 | NonCompanion | test.kt:63:3:63:28 | setNonStaticProp(...) | test.kt:63:3:63:14 | INSTANCE | instance |
|
||||
| test.kt:31:1:47:1 | NonCompanion | test.kt:63:45:63:54 | getStaticProp(...) | test.kt:63:45:63:54 | NonCompanion | static |
|
||||
| test.kt:31:1:47:1 | NonCompanion | test.kt:64:3:64:35 | setPropWithStaticGetter(...) | test.kt:64:3:64:14 | INSTANCE | instance |
|
||||
| test.kt:31:1:47:1 | NonCompanion | test.kt:64:52:64:71 | getPropWithStaticSetter(...) | test.kt:64:39:64:50 | INSTANCE | instance |
|
||||
| test.kt:31:1:47:1 | NonCompanion | test.kt:65:3:65:35 | setPropWithStaticSetter(...) | test.kt:65:3:65:35 | NonCompanion | static |
|
||||
| test.kt:31:1:47:1 | NonCompanion | test.kt:65:52:65:71 | getPropWithStaticGetter(...) | test.kt:65:52:65:71 | NonCompanion | static |
|
||||
@@ -0,0 +1,67 @@
|
||||
// Test both definining static members, and referring to an object's other static members, in companion object and non-companion object contexts.
|
||||
// For the companion object all the references to other properties and methods should extract as ordinary instance calls and field read and writes,
|
||||
// but those methods / getters / setters that are annotated static should get an additional static proxy method defined on the surrounding class--
|
||||
// for example, we should see (using Java notation) public static String HasCompanion.staticMethod(String s) { return Companion.staticMethod(s); }.
|
||||
// For the non-companion object, the static-annotated methods should themselves be extracted as static members, and calls / gets / sets that use them
|
||||
// should extract as static calls. Static members using non-static ones should extract like staticMethod(...) { INSTANCE.nonStaticMethod(...) },
|
||||
// where the reference to INSTANCE replaces what would normally be a `this` reference.
|
||||
|
||||
public class HasCompanion {
|
||||
|
||||
companion object {
|
||||
|
||||
@JvmStatic fun staticMethod(s: String): String = nonStaticMethod(s)
|
||||
fun nonStaticMethod(s: String): String = staticMethod(s)
|
||||
|
||||
@JvmStatic var staticProp: String = "a"
|
||||
var nonStaticProp: String = "b"
|
||||
|
||||
var propWithStaticGetter: String
|
||||
@JvmStatic get() = propWithStaticSetter
|
||||
set(s: String) { propWithStaticSetter = s }
|
||||
|
||||
var propWithStaticSetter: String
|
||||
get() = propWithStaticGetter
|
||||
@JvmStatic set(s: String) { propWithStaticGetter = s }
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
object NonCompanion {
|
||||
|
||||
@JvmStatic fun staticMethod(s: String): String = nonStaticMethod(s)
|
||||
fun nonStaticMethod(s: String): String = staticMethod(s)
|
||||
|
||||
@JvmStatic var staticProp: String = "a"
|
||||
var nonStaticProp: String = "b"
|
||||
|
||||
var propWithStaticGetter: String
|
||||
@JvmStatic get() = propWithStaticSetter
|
||||
set(s: String) { propWithStaticSetter = s }
|
||||
|
||||
var propWithStaticSetter: String
|
||||
get() = propWithStaticGetter
|
||||
@JvmStatic set(s: String) { propWithStaticGetter = s }
|
||||
|
||||
}
|
||||
|
||||
fun externalUser() {
|
||||
|
||||
// These all extract as instance calls (to HasCompanion.Companion), since a Kotlin caller won't use the static proxy methods generated by the @JvmStatic annotation.
|
||||
HasCompanion.staticMethod("1")
|
||||
HasCompanion.nonStaticMethod("2")
|
||||
HasCompanion.staticProp = HasCompanion.nonStaticProp
|
||||
HasCompanion.nonStaticProp = HasCompanion.staticProp
|
||||
HasCompanion.propWithStaticGetter = HasCompanion.propWithStaticSetter
|
||||
HasCompanion.propWithStaticSetter = HasCompanion.propWithStaticGetter
|
||||
|
||||
// These extract as static methods, since there is no proxy method in the non-companion object case.
|
||||
NonCompanion.staticMethod("1")
|
||||
NonCompanion.nonStaticMethod("2")
|
||||
NonCompanion.staticProp = NonCompanion.nonStaticProp
|
||||
NonCompanion.nonStaticProp = NonCompanion.staticProp
|
||||
NonCompanion.propWithStaticGetter = NonCompanion.propWithStaticSetter
|
||||
NonCompanion.propWithStaticSetter = NonCompanion.propWithStaticGetter
|
||||
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
import java
|
||||
|
||||
query predicate staticMembers(RefType declType, Member m, string kind) {
|
||||
m.fromSource() and
|
||||
m.isStatic() and
|
||||
m.getDeclaringType() = declType and
|
||||
kind = m.getAPrimaryQlClass()
|
||||
}
|
||||
|
||||
from Call call, Callable callable, RefType declType, Expr qualifier, string callType
|
||||
where
|
||||
call.getCallee() = callable and
|
||||
declType = callable.getDeclaringType() and
|
||||
qualifier = call.getQualifier() and
|
||||
if callable.isStatic() then callType = "static" else callType = "instance"
|
||||
select declType, call, qualifier, callType
|
||||
@@ -26,7 +26,7 @@ reflection.kt:
|
||||
# 50| 1: [Constructor]
|
||||
# 50| 5: [BlockStmt] { ... }
|
||||
# 50| 0: [SuperConstructorInvocationStmt] super(...)
|
||||
# 50| 1: [Method] get
|
||||
# 50| 2: [Method] get
|
||||
#-----| 4: (Parameters)
|
||||
# 50| 0: [Parameter] a0
|
||||
# 50| 5: [BlockStmt] { ... }
|
||||
@@ -34,7 +34,7 @@ reflection.kt:
|
||||
# 50| 0: [MethodAccess] getLastChar(...)
|
||||
# 50| -1: [TypeAccess] ReflectionKt
|
||||
# 50| 0: [VarAccess] a0
|
||||
# 50| 1: [Method] invoke
|
||||
# 50| 3: [Method] invoke
|
||||
#-----| 4: (Parameters)
|
||||
# 50| 0: [Parameter] a0
|
||||
# 50| 5: [BlockStmt] { ... }
|
||||
@@ -62,16 +62,16 @@ reflection.kt:
|
||||
# 51| 0: [VarAccess] this.<extensionReceiver>
|
||||
# 51| -1: [ThisAccess] this
|
||||
# 51| 1: [VarAccess] <extensionReceiver>
|
||||
# 51| 1: [FieldDeclaration] String <extensionReceiver>;
|
||||
# 51| 2: [FieldDeclaration] String <extensionReceiver>;
|
||||
# 51| -1: [TypeAccess] String
|
||||
# 51| 1: [Method] get
|
||||
# 51| 3: [Method] get
|
||||
# 51| 5: [BlockStmt] { ... }
|
||||
# 51| 0: [ReturnStmt] return ...
|
||||
# 51| 0: [MethodAccess] getLastChar(...)
|
||||
# 51| -1: [TypeAccess] ReflectionKt
|
||||
# 51| 0: [VarAccess] this.<extensionReceiver>
|
||||
# 51| -1: [ThisAccess] this
|
||||
# 51| 1: [Method] invoke
|
||||
# 51| 4: [Method] invoke
|
||||
# 51| 5: [BlockStmt] { ... }
|
||||
# 51| 0: [ReturnStmt] return ...
|
||||
# 51| 0: [MethodAccess] get(...)
|
||||
@@ -124,7 +124,7 @@ reflection.kt:
|
||||
# 97| 1: [Constructor]
|
||||
# 97| 5: [BlockStmt] { ... }
|
||||
# 97| 0: [SuperConstructorInvocationStmt] super(...)
|
||||
# 97| 1: [Method] invoke
|
||||
# 97| 2: [Method] invoke
|
||||
#-----| 4: (Parameters)
|
||||
# 97| 0: [Parameter] a0
|
||||
# 97| 5: [BlockStmt] { ... }
|
||||
@@ -148,7 +148,7 @@ reflection.kt:
|
||||
# 98| 1: [Constructor]
|
||||
# 98| 5: [BlockStmt] { ... }
|
||||
# 98| 0: [SuperConstructorInvocationStmt] super(...)
|
||||
# 98| 1: [Method] invoke
|
||||
# 98| 2: [Method] invoke
|
||||
#-----| 4: (Parameters)
|
||||
# 98| 0: [Parameter] a0
|
||||
# 98| 5: [BlockStmt] { ... }
|
||||
@@ -180,7 +180,10 @@ reflection.kt:
|
||||
# 99| 0: [VarAccess] this.<dispatchReceiver>
|
||||
# 99| -1: [ThisAccess] this
|
||||
# 99| 1: [VarAccess] <dispatchReceiver>
|
||||
# 99| 1: [Method] invoke
|
||||
# 99| 2: [FieldDeclaration] Class2<Integer> <dispatchReceiver>;
|
||||
# 99| -1: [TypeAccess] Class2<Integer>
|
||||
# 99| 0: [TypeAccess] Integer
|
||||
# 99| 3: [Method] invoke
|
||||
#-----| 4: (Parameters)
|
||||
# 99| 0: [Parameter] a0
|
||||
# 99| 5: [BlockStmt] { ... }
|
||||
@@ -191,9 +194,6 @@ reflection.kt:
|
||||
# 99| -2: [VarAccess] this.<dispatchReceiver>
|
||||
# 99| -1: [ThisAccess] this
|
||||
# 99| 0: [VarAccess] a0
|
||||
# 99| 1: [FieldDeclaration] Class2<Integer> <dispatchReceiver>;
|
||||
# 99| -1: [TypeAccess] Class2<Integer>
|
||||
# 99| 0: [TypeAccess] Integer
|
||||
# 99| -3: [TypeAccess] Function1<String,Inner<String>>
|
||||
# 99| 0: [TypeAccess] String
|
||||
# 99| 1: [TypeAccess] Inner<String>
|
||||
@@ -260,7 +260,7 @@ reflection.kt:
|
||||
# 126| 1: [Constructor]
|
||||
# 126| 5: [BlockStmt] { ... }
|
||||
# 126| 0: [SuperConstructorInvocationStmt] super(...)
|
||||
# 126| 1: [Method] fn1
|
||||
# 126| 2: [Method] fn1
|
||||
# 126| 3: [TypeAccess] Unit
|
||||
# 126| 5: [BlockStmt] { ... }
|
||||
# 126| 0: [ExprStmt] <Expr>;
|
||||
@@ -274,7 +274,7 @@ reflection.kt:
|
||||
# 126| 1: [Constructor]
|
||||
# 126| 5: [BlockStmt] { ... }
|
||||
# 126| 0: [SuperConstructorInvocationStmt] super(...)
|
||||
# 126| 1: [Method] invoke
|
||||
# 126| 2: [Method] invoke
|
||||
# 126| 5: [BlockStmt] { ... }
|
||||
# 126| 0: [ReturnStmt] return ...
|
||||
# 126| 0: [MethodAccess] fn1(...)
|
||||
@@ -296,7 +296,7 @@ reflection.kt:
|
||||
# 7| 1: [Constructor]
|
||||
# 7| 5: [BlockStmt] { ... }
|
||||
# 7| 0: [SuperConstructorInvocationStmt] super(...)
|
||||
# 7| 1: [Method] invoke
|
||||
# 7| 2: [Method] invoke
|
||||
#-----| 4: (Parameters)
|
||||
# 7| 0: [Parameter] a0
|
||||
# 7| 1: [Parameter] a1
|
||||
@@ -321,14 +321,14 @@ reflection.kt:
|
||||
# 10| 1: [Constructor]
|
||||
# 10| 5: [BlockStmt] { ... }
|
||||
# 10| 0: [SuperConstructorInvocationStmt] super(...)
|
||||
# 10| 1: [Method] get
|
||||
# 10| 2: [Method] get
|
||||
#-----| 4: (Parameters)
|
||||
# 10| 0: [Parameter] a0
|
||||
# 10| 5: [BlockStmt] { ... }
|
||||
# 10| 0: [ReturnStmt] return ...
|
||||
# 10| 0: [MethodAccess] getP0(...)
|
||||
# 10| -1: [VarAccess] a0
|
||||
# 10| 1: [Method] invoke
|
||||
# 10| 3: [Method] invoke
|
||||
#-----| 4: (Parameters)
|
||||
# 10| 0: [Parameter] a0
|
||||
# 10| 5: [BlockStmt] { ... }
|
||||
@@ -367,7 +367,11 @@ reflection.kt:
|
||||
# 14| 0: [VarAccess] this.<dispatchReceiver>
|
||||
# 14| -1: [ThisAccess] this
|
||||
# 14| 1: [VarAccess] <dispatchReceiver>
|
||||
# 14| 1: [Method] invoke
|
||||
# 14| 2: [FieldDeclaration] KProperty1<C,Integer> <dispatchReceiver>;
|
||||
# 14| -1: [TypeAccess] KProperty1<C,Integer>
|
||||
# 14| 0: [TypeAccess] C
|
||||
# 14| 1: [TypeAccess] Integer
|
||||
# 14| 3: [Method] invoke
|
||||
#-----| 4: (Parameters)
|
||||
# 14| 0: [Parameter] a0
|
||||
# 14| 5: [BlockStmt] { ... }
|
||||
@@ -376,10 +380,6 @@ reflection.kt:
|
||||
# 14| -1: [VarAccess] this.<dispatchReceiver>
|
||||
# 14| -1: [ThisAccess] this
|
||||
# 14| 0: [VarAccess] a0
|
||||
# 14| 1: [FieldDeclaration] KProperty1<C,Integer> <dispatchReceiver>;
|
||||
# 14| -1: [TypeAccess] KProperty1<C,Integer>
|
||||
# 14| 0: [TypeAccess] C
|
||||
# 14| 1: [TypeAccess] Integer
|
||||
# 14| -3: [TypeAccess] Function1<C,Integer>
|
||||
# 14| 0: [TypeAccess] C
|
||||
# 14| 1: [TypeAccess] Integer
|
||||
@@ -398,15 +398,15 @@ reflection.kt:
|
||||
# 15| 0: [VarAccess] this.<dispatchReceiver>
|
||||
# 15| -1: [ThisAccess] this
|
||||
# 15| 1: [VarAccess] <dispatchReceiver>
|
||||
# 15| 1: [FieldDeclaration] C <dispatchReceiver>;
|
||||
# 15| 2: [FieldDeclaration] C <dispatchReceiver>;
|
||||
# 15| -1: [TypeAccess] C
|
||||
# 15| 1: [Method] get
|
||||
# 15| 3: [Method] get
|
||||
# 15| 5: [BlockStmt] { ... }
|
||||
# 15| 0: [ReturnStmt] return ...
|
||||
# 15| 0: [MethodAccess] getP0(...)
|
||||
# 15| -1: [VarAccess] this.<dispatchReceiver>
|
||||
# 15| -1: [ThisAccess] this
|
||||
# 15| 1: [Method] invoke
|
||||
# 15| 4: [Method] invoke
|
||||
# 15| 5: [BlockStmt] { ... }
|
||||
# 15| 0: [ReturnStmt] return ...
|
||||
# 15| 0: [MethodAccess] get(...)
|
||||
@@ -422,14 +422,14 @@ reflection.kt:
|
||||
# 17| 1: [Constructor]
|
||||
# 17| 5: [BlockStmt] { ... }
|
||||
# 17| 0: [SuperConstructorInvocationStmt] super(...)
|
||||
# 17| 1: [Method] get
|
||||
# 17| 2: [Method] get
|
||||
#-----| 4: (Parameters)
|
||||
# 17| 0: [Parameter] a0
|
||||
# 17| 5: [BlockStmt] { ... }
|
||||
# 17| 0: [ReturnStmt] return ...
|
||||
# 17| 0: [MethodAccess] getP1(...)
|
||||
# 17| -1: [VarAccess] a0
|
||||
# 17| 1: [Method] invoke
|
||||
# 17| 3: [Method] invoke
|
||||
#-----| 4: (Parameters)
|
||||
# 17| 0: [Parameter] a0
|
||||
# 17| 5: [BlockStmt] { ... }
|
||||
@@ -437,7 +437,7 @@ reflection.kt:
|
||||
# 17| 0: [MethodAccess] get(...)
|
||||
# 17| -1: [ThisAccess] this
|
||||
# 17| 0: [VarAccess] a0
|
||||
# 17| 1: [Method] set
|
||||
# 17| 4: [Method] set
|
||||
#-----| 4: (Parameters)
|
||||
# 17| 0: [Parameter] a0
|
||||
# 17| 1: [Parameter] a1
|
||||
@@ -478,7 +478,11 @@ reflection.kt:
|
||||
# 21| 0: [VarAccess] this.<dispatchReceiver>
|
||||
# 21| -1: [ThisAccess] this
|
||||
# 21| 1: [VarAccess] <dispatchReceiver>
|
||||
# 21| 1: [Method] invoke
|
||||
# 21| 2: [FieldDeclaration] KMutableProperty1<C,Integer> <dispatchReceiver>;
|
||||
# 21| -1: [TypeAccess] KMutableProperty1<C,Integer>
|
||||
# 21| 0: [TypeAccess] C
|
||||
# 21| 1: [TypeAccess] Integer
|
||||
# 21| 3: [Method] invoke
|
||||
#-----| 4: (Parameters)
|
||||
# 21| 0: [Parameter] a0
|
||||
# 21| 1: [Parameter] a1
|
||||
@@ -489,10 +493,6 @@ reflection.kt:
|
||||
# 21| -1: [ThisAccess] this
|
||||
# 21| 0: [VarAccess] a0
|
||||
# 21| 1: [VarAccess] a1
|
||||
# 21| 1: [FieldDeclaration] KMutableProperty1<C,Integer> <dispatchReceiver>;
|
||||
# 21| -1: [TypeAccess] KMutableProperty1<C,Integer>
|
||||
# 21| 0: [TypeAccess] C
|
||||
# 21| 1: [TypeAccess] Integer
|
||||
# 21| -3: [TypeAccess] Function2<C,Integer,Unit>
|
||||
# 21| 0: [TypeAccess] C
|
||||
# 21| 1: [TypeAccess] Integer
|
||||
@@ -512,20 +512,20 @@ reflection.kt:
|
||||
# 22| 0: [VarAccess] this.<dispatchReceiver>
|
||||
# 22| -1: [ThisAccess] this
|
||||
# 22| 1: [VarAccess] <dispatchReceiver>
|
||||
# 22| 1: [FieldDeclaration] C <dispatchReceiver>;
|
||||
# 22| 2: [FieldDeclaration] C <dispatchReceiver>;
|
||||
# 22| -1: [TypeAccess] C
|
||||
# 22| 1: [Method] get
|
||||
# 22| 3: [Method] get
|
||||
# 22| 5: [BlockStmt] { ... }
|
||||
# 22| 0: [ReturnStmt] return ...
|
||||
# 22| 0: [MethodAccess] getP1(...)
|
||||
# 22| -1: [VarAccess] this.<dispatchReceiver>
|
||||
# 22| -1: [ThisAccess] this
|
||||
# 22| 1: [Method] invoke
|
||||
# 22| 4: [Method] invoke
|
||||
# 22| 5: [BlockStmt] { ... }
|
||||
# 22| 0: [ReturnStmt] return ...
|
||||
# 22| 0: [MethodAccess] get(...)
|
||||
# 22| -1: [ThisAccess] this
|
||||
# 22| 1: [Method] set
|
||||
# 22| 5: [Method] set
|
||||
#-----| 4: (Parameters)
|
||||
# 22| 0: [Parameter] a0
|
||||
# 22| 5: [BlockStmt] { ... }
|
||||
@@ -556,7 +556,7 @@ reflection.kt:
|
||||
# 24| 1: [Constructor]
|
||||
# 24| 5: [BlockStmt] { ... }
|
||||
# 24| 0: [SuperConstructorInvocationStmt] super(...)
|
||||
# 24| 1: [Method] invoke
|
||||
# 24| 2: [Method] invoke
|
||||
# 24| 3: [TypeAccess] boolean
|
||||
#-----| 4: (Parameters)
|
||||
# 24| 0: [Parameter] it
|
||||
@@ -608,7 +608,7 @@ reflection.kt:
|
||||
# 33| 0: [ReturnStmt] return ...
|
||||
# 33| 0: [VarAccess] this.p0
|
||||
# 33| -1: [ThisAccess] this
|
||||
# 33| 2: [FieldDeclaration] int p0;
|
||||
# 33| 3: [FieldDeclaration] int p0;
|
||||
# 33| -1: [TypeAccess] int
|
||||
# 33| 0: [IntegerLiteral] 1
|
||||
# 34| 4: [Method] getP1
|
||||
@@ -617,7 +617,10 @@ reflection.kt:
|
||||
# 34| 0: [ReturnStmt] return ...
|
||||
# 34| 0: [VarAccess] this.p1
|
||||
# 34| -1: [ThisAccess] this
|
||||
# 34| 4: [Method] setP1
|
||||
# 34| 5: [FieldDeclaration] int p1;
|
||||
# 34| -1: [TypeAccess] int
|
||||
# 34| 0: [IntegerLiteral] 2
|
||||
# 34| 6: [Method] setP1
|
||||
# 34| 3: [TypeAccess] Unit
|
||||
#-----| 4: (Parameters)
|
||||
# 34| 0: [Parameter] <set-?>
|
||||
@@ -628,9 +631,6 @@ reflection.kt:
|
||||
# 34| 0: [VarAccess] this.p1
|
||||
# 34| -1: [ThisAccess] this
|
||||
# 34| 1: [VarAccess] <set-?>
|
||||
# 34| 4: [FieldDeclaration] int p1;
|
||||
# 34| -1: [TypeAccess] int
|
||||
# 34| 0: [IntegerLiteral] 2
|
||||
# 36| 7: [Method] getP2
|
||||
# 36| 3: [TypeAccess] int
|
||||
# 36| 5: [BlockStmt] { ... }
|
||||
@@ -678,7 +678,7 @@ reflection.kt:
|
||||
# 60| 1: [Constructor]
|
||||
# 60| 5: [BlockStmt] { ... }
|
||||
# 60| 0: [SuperConstructorInvocationStmt] super(...)
|
||||
# 60| 1: [Method] invoke
|
||||
# 60| 2: [Method] invoke
|
||||
#-----| 4: (Parameters)
|
||||
# 60| 0: [Parameter] a0
|
||||
# 60| 1: [Parameter] a1
|
||||
@@ -707,7 +707,10 @@ reflection.kt:
|
||||
# 61| 0: [VarAccess] this.<dispatchReceiver>
|
||||
# 61| -1: [ThisAccess] this
|
||||
# 61| 1: [VarAccess] <dispatchReceiver>
|
||||
# 61| 1: [Method] invoke
|
||||
# 61| 2: [FieldDeclaration] Generic<Integer> <dispatchReceiver>;
|
||||
# 61| -1: [TypeAccess] Generic<Integer>
|
||||
# 61| 0: [TypeAccess] Integer
|
||||
# 61| 3: [Method] invoke
|
||||
#-----| 4: (Parameters)
|
||||
# 61| 0: [Parameter] a0
|
||||
# 61| 5: [BlockStmt] { ... }
|
||||
@@ -716,9 +719,6 @@ reflection.kt:
|
||||
# 61| -1: [VarAccess] this.<dispatchReceiver>
|
||||
# 61| -1: [ThisAccess] this
|
||||
# 61| 0: [VarAccess] a0
|
||||
# 61| 1: [FieldDeclaration] Generic<Integer> <dispatchReceiver>;
|
||||
# 61| -1: [TypeAccess] Generic<Integer>
|
||||
# 61| 0: [TypeAccess] Integer
|
||||
# 61| -3: [TypeAccess] Function1<Integer,String>
|
||||
# 61| 0: [TypeAccess] Integer
|
||||
# 61| 1: [TypeAccess] String
|
||||
@@ -733,7 +733,7 @@ reflection.kt:
|
||||
# 62| 1: [Constructor]
|
||||
# 62| 5: [BlockStmt] { ... }
|
||||
# 62| 0: [SuperConstructorInvocationStmt] super(...)
|
||||
# 62| 1: [Method] invoke
|
||||
# 62| 2: [Method] invoke
|
||||
#-----| 4: (Parameters)
|
||||
# 62| 0: [Parameter] a0
|
||||
# 62| 5: [BlockStmt] { ... }
|
||||
@@ -761,7 +761,10 @@ reflection.kt:
|
||||
# 63| 0: [VarAccess] this.<extensionReceiver>
|
||||
# 63| -1: [ThisAccess] this
|
||||
# 63| 1: [VarAccess] <extensionReceiver>
|
||||
# 63| 1: [Method] invoke
|
||||
# 63| 2: [FieldDeclaration] Generic<Integer> <extensionReceiver>;
|
||||
# 63| -1: [TypeAccess] Generic<Integer>
|
||||
# 63| 0: [TypeAccess] Integer
|
||||
# 63| 3: [Method] invoke
|
||||
# 63| 5: [BlockStmt] { ... }
|
||||
# 63| 0: [ReturnStmt] return ...
|
||||
# 63| 0: [MethodAccess] ext1(...)
|
||||
@@ -769,9 +772,6 @@ reflection.kt:
|
||||
# 63| -1: [TypeAccess] ReflectionKt
|
||||
# 63| 0: [VarAccess] this.<extensionReceiver>
|
||||
# 63| -1: [ThisAccess] this
|
||||
# 63| 1: [FieldDeclaration] Generic<Integer> <extensionReceiver>;
|
||||
# 63| -1: [TypeAccess] Generic<Integer>
|
||||
# 63| 0: [TypeAccess] Integer
|
||||
# 63| -3: [TypeAccess] Function0<String>
|
||||
# 63| 0: [TypeAccess] String
|
||||
# 63| 0: [ClassInstanceExpr] new Generic<Integer>(...)
|
||||
@@ -785,7 +785,7 @@ reflection.kt:
|
||||
# 64| 1: [Constructor]
|
||||
# 64| 5: [BlockStmt] { ... }
|
||||
# 64| 0: [SuperConstructorInvocationStmt] super(...)
|
||||
# 64| 1: [Method] invoke
|
||||
# 64| 2: [Method] invoke
|
||||
#-----| 4: (Parameters)
|
||||
# 64| 0: [Parameter] a0
|
||||
# 64| 5: [BlockStmt] { ... }
|
||||
@@ -812,16 +812,16 @@ reflection.kt:
|
||||
# 65| 0: [VarAccess] this.<extensionReceiver>
|
||||
# 65| -1: [ThisAccess] this
|
||||
# 65| 1: [VarAccess] <extensionReceiver>
|
||||
# 65| 1: [Method] invoke
|
||||
# 65| 2: [FieldDeclaration] Generic<Integer> <extensionReceiver>;
|
||||
# 65| -1: [TypeAccess] Generic<Integer>
|
||||
# 65| 0: [TypeAccess] Integer
|
||||
# 65| 3: [Method] invoke
|
||||
# 65| 5: [BlockStmt] { ... }
|
||||
# 65| 0: [ReturnStmt] return ...
|
||||
# 65| 0: [MethodAccess] ext2(...)
|
||||
# 65| -1: [TypeAccess] ReflectionKt
|
||||
# 65| 0: [VarAccess] this.<extensionReceiver>
|
||||
# 65| -1: [ThisAccess] this
|
||||
# 65| 1: [FieldDeclaration] Generic<Integer> <extensionReceiver>;
|
||||
# 65| -1: [TypeAccess] Generic<Integer>
|
||||
# 65| 0: [TypeAccess] Integer
|
||||
# 65| -3: [TypeAccess] Function0<String>
|
||||
# 65| 0: [TypeAccess] String
|
||||
# 65| 0: [ClassInstanceExpr] new Generic<Integer>(...)
|
||||
@@ -835,14 +835,14 @@ reflection.kt:
|
||||
# 67| 1: [Constructor]
|
||||
# 67| 5: [BlockStmt] { ... }
|
||||
# 67| 0: [SuperConstructorInvocationStmt] super(...)
|
||||
# 67| 1: [Method] get
|
||||
# 67| 2: [Method] get
|
||||
#-----| 4: (Parameters)
|
||||
# 67| 0: [Parameter] a0
|
||||
# 67| 5: [BlockStmt] { ... }
|
||||
# 67| 0: [ReturnStmt] return ...
|
||||
# 67| 0: [MethodAccess] getP2(...)
|
||||
# 67| -1: [VarAccess] a0
|
||||
# 67| 1: [Method] invoke
|
||||
# 67| 3: [Method] invoke
|
||||
#-----| 4: (Parameters)
|
||||
# 67| 0: [Parameter] a0
|
||||
# 67| 5: [BlockStmt] { ... }
|
||||
@@ -850,7 +850,7 @@ reflection.kt:
|
||||
# 67| 0: [MethodAccess] get(...)
|
||||
# 67| -1: [ThisAccess] this
|
||||
# 67| 0: [VarAccess] a0
|
||||
# 67| 1: [Method] set
|
||||
# 67| 4: [Method] set
|
||||
#-----| 4: (Parameters)
|
||||
# 67| 0: [Parameter] a0
|
||||
# 67| 1: [Parameter] a1
|
||||
@@ -878,21 +878,21 @@ reflection.kt:
|
||||
# 68| 0: [VarAccess] this.<dispatchReceiver>
|
||||
# 68| -1: [ThisAccess] this
|
||||
# 68| 1: [VarAccess] <dispatchReceiver>
|
||||
# 68| 1: [FieldDeclaration] Generic<Integer> <dispatchReceiver>;
|
||||
# 68| 2: [FieldDeclaration] Generic<Integer> <dispatchReceiver>;
|
||||
# 68| -1: [TypeAccess] Generic<Integer>
|
||||
# 68| 0: [TypeAccess] Integer
|
||||
# 68| 1: [Method] get
|
||||
# 68| 3: [Method] get
|
||||
# 68| 5: [BlockStmt] { ... }
|
||||
# 68| 0: [ReturnStmt] return ...
|
||||
# 68| 0: [MethodAccess] getP2(...)
|
||||
# 68| -1: [VarAccess] this.<dispatchReceiver>
|
||||
# 68| -1: [ThisAccess] this
|
||||
# 68| 1: [Method] invoke
|
||||
# 68| 4: [Method] invoke
|
||||
# 68| 5: [BlockStmt] { ... }
|
||||
# 68| 0: [ReturnStmt] return ...
|
||||
# 68| 0: [MethodAccess] get(...)
|
||||
# 68| -1: [ThisAccess] this
|
||||
# 68| 1: [Method] set
|
||||
# 68| 5: [Method] set
|
||||
#-----| 4: (Parameters)
|
||||
# 68| 0: [Parameter] a0
|
||||
# 68| 5: [BlockStmt] { ... }
|
||||
@@ -921,15 +921,15 @@ reflection.kt:
|
||||
# 70| 0: [VarAccess] this.<dispatchReceiver>
|
||||
# 70| -1: [ThisAccess] this
|
||||
# 70| 1: [VarAccess] <dispatchReceiver>
|
||||
# 70| 1: [FieldDeclaration] IntCompanionObject <dispatchReceiver>;
|
||||
# 70| 2: [FieldDeclaration] IntCompanionObject <dispatchReceiver>;
|
||||
# 70| -1: [TypeAccess] IntCompanionObject
|
||||
# 70| 1: [Method] get
|
||||
# 70| 3: [Method] get
|
||||
# 70| 5: [BlockStmt] { ... }
|
||||
# 70| 0: [ReturnStmt] return ...
|
||||
# 70| 0: [MethodAccess] getMAX_VALUE(...)
|
||||
# 70| -1: [VarAccess] this.<dispatchReceiver>
|
||||
# 70| -1: [ThisAccess] this
|
||||
# 70| 1: [Method] invoke
|
||||
# 70| 4: [Method] invoke
|
||||
# 70| 5: [BlockStmt] { ... }
|
||||
# 70| 0: [ReturnStmt] return ...
|
||||
# 70| 0: [MethodAccess] get(...)
|
||||
@@ -945,11 +945,11 @@ reflection.kt:
|
||||
# 71| 1: [Constructor]
|
||||
# 71| 5: [BlockStmt] { ... }
|
||||
# 71| 0: [SuperConstructorInvocationStmt] super(...)
|
||||
# 71| 1: [Method] get
|
||||
# 71| 2: [Method] get
|
||||
# 71| 5: [BlockStmt] { ... }
|
||||
# 71| 0: [ReturnStmt] return ...
|
||||
# 71| 0: [VarAccess] MAX_VALUE
|
||||
# 71| 1: [Method] invoke
|
||||
# 71| 3: [Method] invoke
|
||||
# 71| 5: [BlockStmt] { ... }
|
||||
# 71| 0: [ReturnStmt] return ...
|
||||
# 71| 0: [MethodAccess] get(...)
|
||||
@@ -971,20 +971,20 @@ reflection.kt:
|
||||
# 72| 0: [VarAccess] this.<dispatchReceiver>
|
||||
# 72| -1: [ThisAccess] this
|
||||
# 72| 1: [VarAccess] <dispatchReceiver>
|
||||
# 72| 1: [FieldDeclaration] Rectangle <dispatchReceiver>;
|
||||
# 72| 2: [FieldDeclaration] Rectangle <dispatchReceiver>;
|
||||
# 72| -1: [TypeAccess] Rectangle
|
||||
# 72| 1: [Method] get
|
||||
# 72| 3: [Method] get
|
||||
# 72| 5: [BlockStmt] { ... }
|
||||
# 72| 0: [ReturnStmt] return ...
|
||||
# 72| 0: [VarAccess] this.<dispatchReceiver>.height
|
||||
# 72| -1: [VarAccess] this.<dispatchReceiver>
|
||||
# 72| -1: [ThisAccess] this
|
||||
# 72| 1: [Method] invoke
|
||||
# 72| 4: [Method] invoke
|
||||
# 72| 5: [BlockStmt] { ... }
|
||||
# 72| 0: [ReturnStmt] return ...
|
||||
# 72| 0: [MethodAccess] get(...)
|
||||
# 72| -1: [ThisAccess] this
|
||||
# 72| 1: [Method] set
|
||||
# 72| 5: [Method] set
|
||||
#-----| 4: (Parameters)
|
||||
# 72| 0: [Parameter] a0
|
||||
# 72| 5: [BlockStmt] { ... }
|
||||
@@ -1040,15 +1040,15 @@ reflection.kt:
|
||||
# 83| 0: [ExprStmt] <Expr>;
|
||||
# 83| 0: [KtInitializerAssignExpr] ...=...
|
||||
# 83| 0: [VarAccess] value
|
||||
# 83| 4: [Method] getValue
|
||||
# 83| 4: [FieldDeclaration] T value;
|
||||
# 83| -1: [TypeAccess] T
|
||||
# 83| 0: [VarAccess] value
|
||||
# 83| 5: [Method] getValue
|
||||
# 83| 3: [TypeAccess] T
|
||||
# 83| 5: [BlockStmt] { ... }
|
||||
# 83| 0: [ReturnStmt] return ...
|
||||
# 83| 0: [VarAccess] this.value
|
||||
# 83| -1: [ThisAccess] this
|
||||
# 83| 4: [FieldDeclaration] T value;
|
||||
# 83| -1: [TypeAccess] T
|
||||
# 83| 0: [VarAccess] value
|
||||
# 85| 6: [Class,GenericType,ParameterizedType] Inner
|
||||
#-----| -2: (Generic Parameters)
|
||||
# 85| 0: [TypeVariable] T1
|
||||
@@ -1082,7 +1082,10 @@ reflection.kt:
|
||||
# 90| 0: [VarAccess] this.<dispatchReceiver>
|
||||
# 90| -1: [ThisAccess] this
|
||||
# 90| 1: [VarAccess] <dispatchReceiver>
|
||||
# 90| 1: [Method] invoke
|
||||
# 90| 2: [FieldDeclaration] Class2 <dispatchReceiver>;
|
||||
# 90| -1: [TypeAccess] Class2
|
||||
# 90| 0: [TypeAccess] T
|
||||
# 90| 3: [Method] invoke
|
||||
#-----| 4: (Parameters)
|
||||
# 90| 0: [Parameter] a0
|
||||
# 90| 5: [BlockStmt] { ... }
|
||||
@@ -1093,9 +1096,6 @@ reflection.kt:
|
||||
# 90| -2: [VarAccess] this.<dispatchReceiver>
|
||||
# 90| -1: [ThisAccess] this
|
||||
# 90| 0: [VarAccess] a0
|
||||
# 90| 1: [FieldDeclaration] Class2 <dispatchReceiver>;
|
||||
# 90| -1: [TypeAccess] Class2
|
||||
# 90| 0: [TypeAccess] T
|
||||
# 90| -3: [TypeAccess] Function1<String,Inner<String>>
|
||||
# 90| 0: [TypeAccess] String
|
||||
# 90| 1: [TypeAccess] Inner<String>
|
||||
@@ -1118,7 +1118,10 @@ reflection.kt:
|
||||
# 105| 0: [ReturnStmt] return ...
|
||||
# 105| 0: [VarAccess] this.prop1
|
||||
# 105| -1: [ThisAccess] this
|
||||
# 105| 2: [Method] setProp1
|
||||
# 105| 3: [FieldDeclaration] int prop1;
|
||||
# 105| -1: [TypeAccess] int
|
||||
# 105| 0: [VarAccess] prop1
|
||||
# 105| 4: [Method] setProp1
|
||||
# 105| 3: [TypeAccess] Unit
|
||||
#-----| 4: (Parameters)
|
||||
# 105| 0: [Parameter] <set-?>
|
||||
@@ -1129,9 +1132,6 @@ reflection.kt:
|
||||
# 105| 0: [VarAccess] this.prop1
|
||||
# 105| -1: [ThisAccess] this
|
||||
# 105| 1: [VarAccess] <set-?>
|
||||
# 105| 2: [FieldDeclaration] int prop1;
|
||||
# 105| -1: [TypeAccess] int
|
||||
# 105| 0: [VarAccess] prop1
|
||||
# 107| 7: [Class] Derived1
|
||||
# 107| 1: [Constructor] Derived1
|
||||
#-----| 4: (Parameters)
|
||||
@@ -1159,20 +1159,20 @@ reflection.kt:
|
||||
# 109| 0: [VarAccess] this.<dispatchReceiver>
|
||||
# 109| -1: [ThisAccess] this
|
||||
# 109| 1: [VarAccess] <dispatchReceiver>
|
||||
# 109| 1: [FieldDeclaration] Derived1 <dispatchReceiver>;
|
||||
# 109| 2: [FieldDeclaration] Derived1 <dispatchReceiver>;
|
||||
# 109| -1: [TypeAccess] Derived1
|
||||
# 109| 1: [Method] get
|
||||
# 109| 3: [Method] get
|
||||
# 109| 5: [BlockStmt] { ... }
|
||||
# 109| 0: [ReturnStmt] return ...
|
||||
# 109| 0: [MethodAccess] getProp1(...)
|
||||
# 109| -1: [VarAccess] this.<dispatchReceiver>
|
||||
# 109| -1: [ThisAccess] this
|
||||
# 109| 1: [Method] invoke
|
||||
# 109| 4: [Method] invoke
|
||||
# 109| 5: [BlockStmt] { ... }
|
||||
# 109| 0: [ReturnStmt] return ...
|
||||
# 109| 0: [MethodAccess] get(...)
|
||||
# 109| -1: [ThisAccess] this
|
||||
# 109| 1: [Method] set
|
||||
# 109| 5: [Method] set
|
||||
#-----| 4: (Parameters)
|
||||
# 109| 0: [Parameter] a0
|
||||
# 109| 5: [BlockStmt] { ... }
|
||||
@@ -1197,7 +1197,7 @@ reflection.kt:
|
||||
# 115| 1: [Constructor]
|
||||
# 115| 5: [BlockStmt] { ... }
|
||||
# 115| 0: [SuperConstructorInvocationStmt] super(...)
|
||||
# 115| 1: [Method] fn1
|
||||
# 115| 2: [Method] fn1
|
||||
# 115| 3: [TypeAccess] Unit
|
||||
#-----| 4: (Parameters)
|
||||
# 115| 0: [Parameter] i
|
||||
@@ -1210,7 +1210,7 @@ reflection.kt:
|
||||
# 116| 1: [Constructor]
|
||||
# 116| 5: [BlockStmt] { ... }
|
||||
# 116| 0: [SuperConstructorInvocationStmt] super(...)
|
||||
# 116| 1: [Method] invoke
|
||||
# 116| 2: [Method] invoke
|
||||
#-----| 4: (Parameters)
|
||||
# 116| 0: [Parameter] a0
|
||||
# 116| 5: [BlockStmt] { ... }
|
||||
|
||||
@@ -232,6 +232,9 @@ modifiers
|
||||
compGenerated
|
||||
| file://<external>/Class2.class:0:0:0:0 | getValue | 3 |
|
||||
| file://<external>/Class2.class:0:0:0:0 | getValue | 3 |
|
||||
| file://<external>/KTypeProjection.class:0:0:0:0 | contravariant | 8 |
|
||||
| file://<external>/KTypeProjection.class:0:0:0:0 | covariant | 8 |
|
||||
| file://<external>/KTypeProjection.class:0:0:0:0 | invariant | 8 |
|
||||
| reflection.kt:33:9:33:23 | getP0 | 3 |
|
||||
| reflection.kt:34:9:34:23 | getP1 | 3 |
|
||||
| reflection.kt:34:9:34:23 | setP1 | 3 |
|
||||
|
||||
Reference in New Issue
Block a user