mirror of
https://github.com/github/codeql.git
synced 2026-04-30 19:26:02 +02:00
Merge pull request #10853 from smowton/smowton/fix/specialised-anon-classes
Kotlin: extract called private methods of specialised types, and specialised instances of anonymous types
This commit is contained in:
@@ -120,11 +120,7 @@ open class KotlinFileExtractor(
|
||||
}
|
||||
|
||||
private fun shouldExtractDecl(declaration: IrDeclaration, extractPrivateMembers: Boolean) =
|
||||
extractPrivateMembers ||
|
||||
when(declaration) {
|
||||
is IrDeclarationWithVisibility -> declaration.visibility.let { it != DescriptorVisibilities.PRIVATE && it != DescriptorVisibilities.PRIVATE_TO_THIS }
|
||||
else -> true
|
||||
}
|
||||
extractPrivateMembers || !isPrivate(declaration)
|
||||
|
||||
fun extractDeclaration(declaration: IrDeclaration, extractPrivateMembers: Boolean, extractFunctionBodies: Boolean) {
|
||||
with("declaration", declaration) {
|
||||
@@ -367,23 +363,37 @@ open class KotlinFileExtractor(
|
||||
}
|
||||
}
|
||||
|
||||
private fun makeTypeParamSubstitution(c: IrClass, argsIncludingOuterClasses: List<IrTypeArgument>?) =
|
||||
when (argsIncludingOuterClasses) {
|
||||
null -> { x: IrType, _: TypeContext, _: IrPluginContext -> x.toRawType() }
|
||||
else -> makeGenericSubstitutionFunction(c, argsIncludingOuterClasses)
|
||||
}
|
||||
|
||||
fun extractDeclarationPrototype(d: IrDeclaration, parentId: Label<out DbReftype>, argsIncludingOuterClasses: List<IrTypeArgument>?, typeParamSubstitutionQ: TypeSubstitution? = null) {
|
||||
val typeParamSubstitution = typeParamSubstitutionQ ?:
|
||||
when(val parent = d.parent) {
|
||||
is IrClass -> makeTypeParamSubstitution(parent, argsIncludingOuterClasses)
|
||||
else -> {
|
||||
logger.warnElement("Unable to extract prototype of local declaration", d)
|
||||
return
|
||||
}
|
||||
}
|
||||
when (d) {
|
||||
is IrFunction -> extractFunction(d, parentId, extractBody = false, extractMethodAndParameterTypeAccesses = false, typeParamSubstitution, argsIncludingOuterClasses)
|
||||
is IrProperty -> extractProperty(d, parentId, extractBackingField = false, extractFunctionBodies = false, extractPrivateMembers = false, typeParamSubstitution, argsIncludingOuterClasses)
|
||||
else -> {}
|
||||
}
|
||||
}
|
||||
|
||||
// `argsIncludingOuterClasses` can be null to describe a raw generic type.
|
||||
// For non-generic types it will be zero-length list.
|
||||
private fun extractNonPrivateMemberPrototypes(c: IrClass, argsIncludingOuterClasses: List<IrTypeArgument>?, id: Label<out DbClassorinterface>) {
|
||||
with("member prototypes", c) {
|
||||
val typeParamSubstitution =
|
||||
when (argsIncludingOuterClasses) {
|
||||
null -> { x: IrType, _: TypeContext, _: IrPluginContext -> x.toRawType() }
|
||||
else -> makeGenericSubstitutionFunction(c, argsIncludingOuterClasses)
|
||||
}
|
||||
val typeParamSubstitution = makeTypeParamSubstitution(c, argsIncludingOuterClasses)
|
||||
|
||||
c.declarations.map {
|
||||
if (shouldExtractDecl(it, false)) {
|
||||
when(it) {
|
||||
is IrFunction -> extractFunction(it, id, extractBody = false, extractMethodAndParameterTypeAccesses = false, typeParamSubstitution, argsIncludingOuterClasses)
|
||||
is IrProperty -> extractProperty(it, id, extractBackingField = false, extractFunctionBodies = false, extractPrivateMembers = false, typeParamSubstitution, argsIncludingOuterClasses)
|
||||
else -> {}
|
||||
}
|
||||
extractDeclarationPrototype(it, id, argsIncludingOuterClasses, typeParamSubstitution)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -583,12 +593,7 @@ open class KotlinFileExtractor(
|
||||
var parent: IrDeclarationParent? = declarationParent
|
||||
while (parent != null) {
|
||||
if (parent is IrClass) {
|
||||
val parentId =
|
||||
if (parent.isAnonymousObject) {
|
||||
useAnonymousClass(parent).javaResult.id.cast<DbClass>()
|
||||
} else {
|
||||
useClassInstance(parent, parentClassTypeArguments).typeResult.id
|
||||
}
|
||||
val parentId = useClassInstance(parent, parentClassTypeArguments).typeResult.id
|
||||
tw.writeEnclInReftype(innerId, parentId)
|
||||
if (innerClass != null && innerClass.isCompanion) {
|
||||
// If we are a companion then our parent has a
|
||||
@@ -868,7 +873,7 @@ open class KotlinFileExtractor(
|
||||
extractTypeAccess(useType(paramType), locId, paramId, -1)
|
||||
}
|
||||
}
|
||||
val paramsSignature = allParamTypeResults.joinToString(separator = ",", prefix = "(", postfix = ")") { it.javaResult.signature }
|
||||
val paramsSignature = allParamTypeResults.joinToString(separator = ",", prefix = "(", postfix = ")") { signatureOrWarn(it.javaResult, f) }
|
||||
val shortName = getDefaultsMethodName(f)
|
||||
|
||||
if (f.symbol is IrConstructorSymbol) {
|
||||
@@ -1078,6 +1083,14 @@ open class KotlinFileExtractor(
|
||||
}
|
||||
}
|
||||
|
||||
private fun signatureOrWarn(t: TypeResult<*>, associatedElement: IrElement?) =
|
||||
t.signature ?: "<signature unavailable>".also {
|
||||
if (associatedElement != null)
|
||||
logger.warnElement("Needed a signature for a type that doesn't have one", associatedElement)
|
||||
else
|
||||
logger.warn("Needed a signature for a type that doesn't have one")
|
||||
}
|
||||
|
||||
private fun forceExtractFunction(f: IrFunction, parentId: Label<out DbReftype>, extractBody: Boolean, extractMethodAndParameterTypeAccesses: Boolean, typeSubstitution: TypeSubstitution?, classTypeArgsIncludingOuterClasses: List<IrTypeArgument>?, extractOrigin: Boolean = true, overriddenAttributes: OverriddenFunctionAttributes? = null): Label<out DbCallable> {
|
||||
with("function", f) {
|
||||
DeclarationStackAdjuster(f, overriddenAttributes).use {
|
||||
@@ -1114,7 +1127,7 @@ open class KotlinFileExtractor(
|
||||
paramTypes
|
||||
}
|
||||
|
||||
val paramsSignature = allParamTypes.joinToString(separator = ",", prefix = "(", postfix = ")") { it.javaResult.signature }
|
||||
val paramsSignature = allParamTypes.joinToString(separator = ",", prefix = "(", postfix = ")") { signatureOrWarn(it.javaResult, f) }
|
||||
|
||||
val adjustedReturnType = addJavaLoweringWildcards(getAdjustedReturnType(f), false, (javaCallable as? JavaMethod)?.returnType)
|
||||
val substReturnType = typeSubstitution?.let { it(adjustedReturnType, TypeContext.RETURN, pluginContext) } ?: adjustedReturnType
|
||||
@@ -2952,20 +2965,8 @@ open class KotlinFileExtractor(
|
||||
logger.errorElement("Constructor call has non-simple type ${eType.javaClass}", e)
|
||||
return
|
||||
}
|
||||
val type = useType(eType)
|
||||
val isAnonymous = eType.isAnonymous
|
||||
val type: TypeResults = if (isAnonymous) {
|
||||
if (e.typeArgumentsCount > 0) {
|
||||
logger.warnElement("Unexpected type arguments (${e.typeArgumentsCount}) for anonymous class constructor call", e)
|
||||
}
|
||||
val c = eType.classifier.owner
|
||||
if (c !is IrClass) {
|
||||
logger.errorElement("Anonymous constructor call type not a class (${c.javaClass})", e)
|
||||
return
|
||||
}
|
||||
useAnonymousClass(c)
|
||||
} else {
|
||||
useType(eType)
|
||||
}
|
||||
val locId = tw.getLocation(e)
|
||||
val valueArgs = (0 until e.valueArgumentsCount).map { e.getValueArgument(it) }
|
||||
// For now, don't try to use default methods for enum constructor calls,
|
||||
@@ -2982,7 +2983,7 @@ open class KotlinFileExtractor(
|
||||
}
|
||||
|
||||
if (isAnonymous) {
|
||||
tw.writeIsAnonymClass(type.javaResult.id.cast<DbClass>(), id)
|
||||
tw.writeIsAnonymClass(type.javaResult.id.cast(), id)
|
||||
}
|
||||
|
||||
val dr = e.dispatchReceiver
|
||||
@@ -4640,7 +4641,7 @@ open class KotlinFileExtractor(
|
||||
Pair(paramId, paramType)
|
||||
}
|
||||
|
||||
val paramsSignature = parameters.joinToString(separator = ",", prefix = "(", postfix = ")") { it.second.javaResult.signature }
|
||||
val paramsSignature = parameters.joinToString(separator = ",", prefix = "(", postfix = ")") { signatureOrWarn(it.second.javaResult, declarationStack.tryPeek()?.first) }
|
||||
|
||||
val rt = useType(returnType, TypeContext.RETURN)
|
||||
tw.writeMethods(methodId, name, "$name$paramsSignature", rt.javaResult.id, parentId, methodId)
|
||||
@@ -5359,6 +5360,8 @@ open class KotlinFileExtractor(
|
||||
|
||||
fun peek() = stack.peek()
|
||||
|
||||
fun tryPeek() = if (stack.isEmpty()) null else stack.peek()
|
||||
|
||||
fun findOverriddenAttributes(f: IrFunction) =
|
||||
stack.lastOrNull { it.first == f } ?.second
|
||||
|
||||
|
||||
@@ -210,10 +210,6 @@ open class KotlinUsesExtractor(
|
||||
// `typeArgs` can be null to describe a raw generic type.
|
||||
// For non-generic types it will be zero-length list.
|
||||
fun useClassInstance(c: IrClass, typeArgs: List<IrTypeArgument>?, inReceiverContext: Boolean = false): UseClassInstanceResult {
|
||||
if (c.isAnonymousObject) {
|
||||
logger.error("Unexpected access to anonymous class instance")
|
||||
}
|
||||
|
||||
val substituteClass = getJavaEquivalentClass(c)
|
||||
|
||||
val extractClass = substituteClass ?: c
|
||||
@@ -418,10 +414,11 @@ open class KotlinUsesExtractor(
|
||||
}
|
||||
|
||||
val fqName = replacedClass.fqNameWhenAvailable
|
||||
val signature = if (fqName == null) {
|
||||
val signature = if (replacedClass.isAnonymousObject) {
|
||||
null
|
||||
} else if (fqName == null) {
|
||||
logger.error("Unable to find signature/fqName for ${replacedClass.name}")
|
||||
// TODO: Should we return null here instead?
|
||||
"<no signature available>"
|
||||
null
|
||||
} else {
|
||||
fqName.asString()
|
||||
}
|
||||
@@ -465,7 +462,7 @@ open class KotlinUsesExtractor(
|
||||
}
|
||||
}
|
||||
|
||||
fun useAnonymousClass(c: IrClass) =
|
||||
private fun useAnonymousClass(c: IrClass) =
|
||||
tw.lm.anonymousTypeMapping.getOrPut(c) {
|
||||
TypeResults(
|
||||
TypeResult(tw.getFreshIdLabel<DbClass>(), "", ""),
|
||||
@@ -473,14 +470,6 @@ open class KotlinUsesExtractor(
|
||||
)
|
||||
}
|
||||
|
||||
fun getExistingAnonymousClassLabel(c: IrClass): Label<out DbType>? {
|
||||
if (!c.isAnonymousObject){
|
||||
return null
|
||||
}
|
||||
|
||||
return tw.lm.anonymousTypeMapping[c]?.javaResult?.id
|
||||
}
|
||||
|
||||
fun fakeKotlinType(): Label<out DbKt_type> {
|
||||
val fakeKotlinPackageId: Label<DbPackage> = tw.getLabelFor("@\"FakeKotlinPackage\"", {
|
||||
tw.writePackages(it, "fake.kotlin")
|
||||
@@ -497,16 +486,6 @@ open class KotlinUsesExtractor(
|
||||
// `args` can be null to describe a raw generic type.
|
||||
// For non-generic types it will be zero-length list.
|
||||
fun useSimpleTypeClass(c: IrClass, args: List<IrTypeArgument>?, hasQuestionMark: Boolean): TypeResults {
|
||||
if (c.isAnonymousObject) {
|
||||
args?.let {
|
||||
if (it.isNotEmpty() && !isUnspecialised(c, it, logger)) {
|
||||
logger.error("Unexpected specialised instance of generic anonymous class")
|
||||
}
|
||||
}
|
||||
|
||||
return useAnonymousClass(c)
|
||||
}
|
||||
|
||||
val classInstanceResult = useClassInstance(c, args)
|
||||
val javaClassId = classInstanceResult.typeResult.id
|
||||
val kotlinQualClassName = getUnquotedClassLabel(c, args).classLabel
|
||||
@@ -795,7 +774,7 @@ open class KotlinUsesExtractor(
|
||||
extractFileClass(dp)
|
||||
}
|
||||
is IrClass ->
|
||||
if (classTypeArguments != null && !dp.isAnonymousObject) {
|
||||
if (classTypeArguments != null) {
|
||||
useClassInstance(dp, classTypeArguments, inReceiverContext).typeResult.id
|
||||
} else {
|
||||
val replacedType = tryReplaceParcelizeRawType(dp)
|
||||
@@ -1319,6 +1298,12 @@ open class KotlinUsesExtractor(
|
||||
}
|
||||
} ?: f
|
||||
|
||||
fun isPrivate(d: IrDeclaration) =
|
||||
when(d) {
|
||||
is IrDeclarationWithVisibility -> d.visibility.let { it == DescriptorVisibilities.PRIVATE || it == DescriptorVisibilities.PRIVATE_TO_THIS }
|
||||
else -> false
|
||||
}
|
||||
|
||||
fun <T: DbCallable> useFunction(f: IrFunction, classTypeArgsIncludingOuterClasses: List<IrTypeArgument>? = null, noReplace: Boolean = false): Label<out T> {
|
||||
return useFunction(f, null, classTypeArgsIncludingOuterClasses, noReplace)
|
||||
}
|
||||
@@ -1330,7 +1315,9 @@ open class KotlinUsesExtractor(
|
||||
}
|
||||
val javaFun = kotlinFunctionToJavaEquivalent(f, noReplace)
|
||||
val label = getFunctionLabel(javaFun, parentId, classTypeArgsIncludingOuterClasses)
|
||||
val id: Label<T> = tw.getLabelFor(label)
|
||||
val id: Label<T> = tw.getLabelFor(label) {
|
||||
extractPrivateSpecialisedDeclaration(f, classTypeArgsIncludingOuterClasses)
|
||||
}
|
||||
if (isExternalDeclaration(javaFun)) {
|
||||
extractFunctionLaterIfExternalFileMember(javaFun)
|
||||
extractExternalEnclosingClassLater(javaFun)
|
||||
@@ -1338,6 +1325,19 @@ open class KotlinUsesExtractor(
|
||||
return id
|
||||
}
|
||||
|
||||
private fun extractPrivateSpecialisedDeclaration(d: IrDeclaration, classTypeArgsIncludingOuterClasses: List<IrTypeArgument>?) {
|
||||
// Note here `classTypeArgsIncludingOuterClasses` being null doesn't signify a raw receiver type but rather that no type args were supplied.
|
||||
// This is because a call to a private method can only be observed inside Kotlin code, and Kotlin can't represent raw types.
|
||||
if (this is KotlinFileExtractor && isPrivate(d) && classTypeArgsIncludingOuterClasses != null && classTypeArgsIncludingOuterClasses.isNotEmpty()) {
|
||||
d.parent.let {
|
||||
when(it) {
|
||||
is IrClass -> this.extractDeclarationPrototype(d, useClassInstance(it, classTypeArgsIncludingOuterClasses).typeResult.id, classTypeArgsIncludingOuterClasses)
|
||||
else -> logger.warnElement("Unable to extract specialised declaration that isn't a member of a class", d)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fun getTypeArgumentLabel(
|
||||
arg: IrTypeArgument
|
||||
): TypeResultWithoutSignature<DbReftype> {
|
||||
@@ -1393,20 +1393,24 @@ open class KotlinUsesExtractor(
|
||||
private fun getUnquotedClassLabel(c: IrClass, argsIncludingOuterClasses: List<IrTypeArgument>?): ClassLabelResults {
|
||||
val pkg = c.packageFqName?.asString() ?: ""
|
||||
val cls = c.name.asString()
|
||||
val label = when (val parent = c.parent) {
|
||||
is IrClass -> {
|
||||
"${getUnquotedClassLabel(parent, listOf()).classLabel}\$$cls"
|
||||
}
|
||||
is IrFunction -> {
|
||||
"{${useFunction<DbMethod>(parent)}}.$cls"
|
||||
}
|
||||
is IrField -> {
|
||||
"{${useField(parent)}}.$cls"
|
||||
}
|
||||
else -> {
|
||||
if (pkg.isEmpty()) cls else "$pkg.$cls"
|
||||
}
|
||||
}
|
||||
val label =
|
||||
if (c.isAnonymousObject)
|
||||
"{${useAnonymousClass(c).javaResult.id}}"
|
||||
else
|
||||
when (val parent = c.parent) {
|
||||
is IrClass -> {
|
||||
"${getUnquotedClassLabel(parent, listOf()).classLabel}\$$cls"
|
||||
}
|
||||
is IrFunction -> {
|
||||
"{${useFunction<DbMethod>(parent)}}.$cls"
|
||||
}
|
||||
is IrField -> {
|
||||
"{${useField(parent)}}.$cls"
|
||||
}
|
||||
else -> {
|
||||
if (pkg.isEmpty()) cls else "$pkg.$cls"
|
||||
}
|
||||
}
|
||||
|
||||
val reorderedArgs = orderTypeArgsLeftToRight(c, argsIncludingOuterClasses)
|
||||
val typeArgLabels = reorderedArgs?.map { getTypeArgumentLabel(it) }
|
||||
@@ -1417,20 +1421,17 @@ open class KotlinUsesExtractor(
|
||||
""
|
||||
else
|
||||
typeArgLabels.takeLast(c.typeParameters.size).joinToString(prefix = "<", postfix = ">", separator = ",") { it.shortName }
|
||||
val shortNamePrefix = if (c.isAnonymousObject) "" else cls
|
||||
|
||||
return ClassLabelResults(
|
||||
label + (typeArgLabels?.joinToString(separator = "") { ";{${it.id}}" } ?: "<>"),
|
||||
cls + typeArgsShortName
|
||||
shortNamePrefix + typeArgsShortName
|
||||
)
|
||||
}
|
||||
|
||||
// `args` can be null to describe a raw generic type.
|
||||
// For non-generic types it will be zero-length list.
|
||||
fun getClassLabel(c: IrClass, argsIncludingOuterClasses: List<IrTypeArgument>?): ClassLabelResults {
|
||||
if (c.isAnonymousObject) {
|
||||
logger.error("Label generation should not be requested for an anonymous class")
|
||||
}
|
||||
|
||||
val unquotedLabel = getUnquotedClassLabel(c, argsIncludingOuterClasses)
|
||||
return ClassLabelResults(
|
||||
"@\"class;${unquotedLabel.classLabel}\"",
|
||||
@@ -1438,10 +1439,6 @@ open class KotlinUsesExtractor(
|
||||
}
|
||||
|
||||
fun useClassSource(c: IrClass): Label<out DbClassorinterface> {
|
||||
if (c.isAnonymousObject) {
|
||||
return useAnonymousClass(c).javaResult.id.cast<DbClass>()
|
||||
}
|
||||
|
||||
// For source classes, the label doesn't include any type arguments
|
||||
val classTypeResult = addClassLabel(c, listOf())
|
||||
return classTypeResult.id
|
||||
@@ -1686,8 +1683,11 @@ open class KotlinUsesExtractor(
|
||||
}
|
||||
}
|
||||
|
||||
fun useProperty(p: IrProperty, parentId: Label<out DbElement>, classTypeArgsIncludingOuterClasses: List<IrTypeArgument>?): Label<out DbKt_property> =
|
||||
tw.getLabelFor<DbKt_property>(getPropertyLabel(p, parentId, classTypeArgsIncludingOuterClasses)).also { extractPropertyLaterIfExternalFileMember(p) }
|
||||
fun useProperty(p: IrProperty, parentId: Label<out DbElement>, classTypeArgsIncludingOuterClasses: List<IrTypeArgument>?) =
|
||||
tw.getLabelFor<DbKt_property>(getPropertyLabel(p, parentId, classTypeArgsIncludingOuterClasses)) {
|
||||
extractPropertyLaterIfExternalFileMember(p)
|
||||
extractPrivateSpecialisedDeclaration(p, classTypeArgsIncludingOuterClasses)
|
||||
}
|
||||
|
||||
fun getEnumEntryLabel(ee: IrEnumEntry): String {
|
||||
val parentId = useDeclarationParent(ee.parent, false)
|
||||
|
||||
@@ -127,12 +127,7 @@ class CommentExtractor(private val fileExtractor: KotlinFileExtractor, private v
|
||||
// local functions are not named globally, so we need to get them from the local function label cache
|
||||
label = "local function ${element.name.asString()}"
|
||||
fileExtractor.getExistingLocallyVisibleFunctionLabel(element)
|
||||
} else if (element is IrClass && element.isAnonymousObject) {
|
||||
// anonymous objects are not named globally, so we need to get them from the cache
|
||||
label = "anonymous class ${element.name.asString()}"
|
||||
fileExtractor.getExistingAnonymousClassLabel(element)
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
label = getLabelForNamedElement(element) ?: return null
|
||||
tw.getExistingLabelFor<DbTop>(label)
|
||||
}
|
||||
@@ -145,12 +140,7 @@ class CommentExtractor(private val fileExtractor: KotlinFileExtractor, private v
|
||||
|
||||
private fun getLabelForNamedElement(element: IrElement) : String? {
|
||||
when (element) {
|
||||
is IrClass ->
|
||||
return if (element.isAnonymousObject) {
|
||||
null
|
||||
} else {
|
||||
fileExtractor.getClassLabel(element, listOf()).classLabel
|
||||
}
|
||||
is IrClass -> return fileExtractor.getClassLabel(element, listOf()).classLabel
|
||||
is IrTypeParameter -> return fileExtractor.getTypeParameterLabel(element)
|
||||
is IrFunction -> {
|
||||
return if (element.isLocalFunction()) {
|
||||
|
||||
@@ -12,7 +12,7 @@ package com.github.codeql
|
||||
* `shortName` is a Java primitive name (e.g. "int"), a class short name with Java-style type arguments ("InnerClass<E>" or
|
||||
* "OuterClass<ConcreteArgument>" or "OtherClass<? extends Bound>") or an array ("componentShortName[]").
|
||||
*/
|
||||
data class TypeResultGeneric<SignatureType,out LabelType: AnyDbType>(val id: Label<out LabelType>, val signature: SignatureType, val shortName: String) {
|
||||
data class TypeResultGeneric<SignatureType,out LabelType: AnyDbType>(val id: Label<out LabelType>, val signature: SignatureType?, val shortName: String) {
|
||||
fun <U: AnyDbType> cast(): TypeResultGeneric<SignatureType,U> {
|
||||
@Suppress("UNCHECKED_CAST")
|
||||
return this as TypeResultGeneric<SignatureType,U>
|
||||
|
||||
@@ -686,7 +686,7 @@ class SrcRefType extends RefType {
|
||||
/** A class declaration. */
|
||||
class Class extends ClassOrInterface, @class {
|
||||
/** Holds if this class is an anonymous class. */
|
||||
predicate isAnonymous() { isAnonymClass(this, _) }
|
||||
predicate isAnonymous() { isAnonymClass(this.getSourceDeclaration(), _) }
|
||||
|
||||
override RefType getSourceDeclaration() { classes(this, _, _, result) }
|
||||
|
||||
@@ -800,10 +800,13 @@ class AnonymousClass extends NestedClass {
|
||||
}
|
||||
|
||||
/** Gets the class instance expression where this anonymous class occurs. */
|
||||
ClassInstanceExpr getClassInstanceExpr() { isAnonymClass(this, result) }
|
||||
ClassInstanceExpr getClassInstanceExpr() { isAnonymClass(this.getSourceDeclaration(), result) }
|
||||
|
||||
override string toString() {
|
||||
result = "new " + this.getClassInstanceExpr().getTypeName() + "(...) { ... }"
|
||||
// Include super.toString, i.e. the name given in the database, because for Kotlin anonymous
|
||||
// classes we can get specialisations of anonymous generic types, and this will supply the
|
||||
// trailing type arguments.
|
||||
result = "new " + this.getClassInstanceExpr().getTypeName() + "(...) { ... }" + super.toString()
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -676,7 +676,7 @@ generic_anonymous.kt:
|
||||
# 7| 0: [MethodAccess] getMember(...)
|
||||
# 7| -1: [MethodAccess] getX$private(...)
|
||||
# 7| -1: [ThisAccess] this
|
||||
# 15| 3: [Class,GenericType,ParameterizedType] Outer
|
||||
# 15| 4: [Class,GenericType,ParameterizedType] Outer
|
||||
#-----| -2: (Generic Parameters)
|
||||
# 15| 0: [TypeVariable] T0
|
||||
# 15| 6: [Constructor] Outer
|
||||
|
||||
@@ -68,7 +68,9 @@ extendsOrImplements
|
||||
| file://<external>/SuperChain1.class:0:0:0:0 | SuperChain1<T5,String> | file://<external>/Object.class:0:0:0:0 | Object | extends |
|
||||
| file://<external>/SuperChain2.class:0:0:0:0 | SuperChain2<T5,String> | file://<external>/SuperChain1.class:0:0:0:0 | SuperChain1<T5,String> | extends |
|
||||
| generic_anonymous.kt:1:1:9:1 | Generic | file://<external>/Object.class:0:0:0:0 | Object | extends |
|
||||
| generic_anonymous.kt:1:1:9:1 | Generic<> | file://<external>/Object.class:0:0:0:0 | Object | extends |
|
||||
| generic_anonymous.kt:3:19:5:3 | new Object(...) { ... } | file://<external>/Object.class:0:0:0:0 | Object | extends |
|
||||
| generic_anonymous.kt:3:19:5:3 | new Object(...) { ... }<> | file://<external>/Object.class:0:0:0:0 | Object | extends |
|
||||
| generic_anonymous.kt:15:1:33:1 | Outer | file://<external>/Object.class:0:0:0:0 | Object | extends |
|
||||
| generic_anonymous.kt:16:5:18:5 | C0 | file://<external>/Object.class:0:0:0:0 | Object | extends |
|
||||
| generic_anonymous.kt:20:5:22:5 | C1 | file://<external>/Object.class:0:0:0:0 | Object | extends |
|
||||
@@ -154,12 +156,17 @@ extendsOrImplements
|
||||
| file://<external>/C1$Local1.class:0:0:0:0 | Local1<Integer> | file://<external>/Object.class:0:0:0:0 | Object |
|
||||
| file://<external>/C1$Local2.class:0:0:0:0 | Local2<Integer> | file://<external>/Object.class:0:0:0:0 | Object |
|
||||
| file://<external>/Generic.class:0:0:0:0 | Generic<Integer> | file://<external>/Object.class:0:0:0:0 | Object |
|
||||
| file://<external>/Generic.class:0:0:0:0 | Generic<Integer> | generic_anonymous.kt:1:1:9:1 | Generic<> |
|
||||
| file://<external>/Generic.class:0:0:0:0 | Generic<String> | file://<external>/Object.class:0:0:0:0 | Object |
|
||||
| file://<external>/Generic.class:0:0:0:0 | Generic<String> | generic_anonymous.kt:1:1:9:1 | Generic<> |
|
||||
| file://<external>/SuperChain1.class:0:0:0:0 | SuperChain1<T3,String> | file://<external>/Object.class:0:0:0:0 | Object |
|
||||
| file://<external>/SuperChain1.class:0:0:0:0 | SuperChain1<T5,String> | file://<external>/Object.class:0:0:0:0 | Object |
|
||||
| file://<external>/SuperChain2.class:0:0:0:0 | SuperChain2<T5,String> | file://<external>/SuperChain1.class:0:0:0:0 | SuperChain1<T5,String> |
|
||||
| generic_anonymous.kt:1:1:9:1 | Generic | file://<external>/Object.class:0:0:0:0 | Object |
|
||||
| generic_anonymous.kt:1:1:9:1 | Generic | generic_anonymous.kt:1:1:9:1 | Generic<> |
|
||||
| generic_anonymous.kt:1:1:9:1 | Generic<> | file://<external>/Object.class:0:0:0:0 | Object |
|
||||
| generic_anonymous.kt:3:19:5:3 | new Object(...) { ... } | file://<external>/Object.class:0:0:0:0 | Object |
|
||||
| generic_anonymous.kt:3:19:5:3 | new Object(...) { ... }<> | file://<external>/Object.class:0:0:0:0 | Object |
|
||||
| generic_anonymous.kt:15:1:33:1 | Outer | file://<external>/Object.class:0:0:0:0 | Object |
|
||||
| generic_anonymous.kt:25:9:31:9 | | file://<external>/Object.class:0:0:0:0 | Object |
|
||||
| generic_anonymous.kt:26:13:26:37 | new Object(...) { ... } | file://<external>/Outer$C0.class:0:0:0:0 | C0<U2> |
|
||||
|
||||
@@ -5,33 +5,34 @@ calls
|
||||
| Test.java:23:5:23:25 | getter(...) | Test.java:16:22:16:25 | user | Test.java:14:14:14:17 | Test | Generic2.class:0:0:0:0 | getter | Generic2.class:0:0:0:0 | Generic2<? extends String> |
|
||||
| Test.java:26:5:26:35 | setter(...) | Test.java:16:22:16:25 | user | Test.java:14:14:14:17 | Test | Generic2.class:0:0:0:0 | setter | Generic2.class:0:0:0:0 | Generic2<? super String> |
|
||||
| Test.java:27:5:27:24 | getter(...) | Test.java:16:22:16:25 | user | Test.java:14:14:14:17 | Test | Generic2.class:0:0:0:0 | getter | Generic2.class:0:0:0:0 | Generic2<? super String> |
|
||||
| test.kt:5:32:5:46 | identity(...) | test.kt:5:3:5:46 | identity2 | test.kt:1:1:10:1 | Generic | test.kt:6:3:6:35 | identity | test.kt:1:1:10:1 | Generic |
|
||||
| test.kt:7:21:7:26 | getStored(...) | test.kt:7:3:7:26 | getter | test.kt:1:1:10:1 | Generic | test.kt:3:3:3:19 | getStored | test.kt:1:1:10:1 | Generic |
|
||||
| test.kt:8:26:8:31 | setStored(...) | test.kt:8:3:8:41 | setter | test.kt:1:1:10:1 | Generic | test.kt:3:3:3:19 | setStored | test.kt:1:1:10:1 | Generic |
|
||||
| test.kt:15:13:15:35 | identity(...) | test.kt:12:1:25:1 | user | test.kt:0:0:0:0 | TestKt | file:///!unknown-binary-location/Generic.class:0:0:0:0 | identity | file:///!unknown-binary-location/Generic.class:0:0:0:0 | Generic<String> |
|
||||
| test.kt:16:13:16:36 | identity2(...) | test.kt:12:1:25:1 | user | test.kt:0:0:0:0 | TestKt | file:///!unknown-binary-location/Generic.class:0:0:0:0 | identity2 | file:///!unknown-binary-location/Generic.class:0:0:0:0 | Generic<String> |
|
||||
| test.kt:19:16:19:23 | getter(...) | test.kt:12:1:25:1 | user | test.kt:0:0:0:0 | TestKt | file:///!unknown-binary-location/Generic.class:0:0:0:0 | getter | file:///!unknown-binary-location/Generic.class:0:0:0:0 | Generic<? extends String> |
|
||||
| test.kt:22:15:22:33 | setter(...) | test.kt:12:1:25:1 | user | test.kt:0:0:0:0 | TestKt | file:///!unknown-binary-location/Generic.class:0:0:0:0 | setter | file:///!unknown-binary-location/Generic.class:0:0:0:0 | Generic<? super String> |
|
||||
| test.kt:23:15:23:22 | getter(...) | test.kt:12:1:25:1 | user | test.kt:0:0:0:0 | TestKt | file:///!unknown-binary-location/Generic.class:0:0:0:0 | getter | file:///!unknown-binary-location/Generic.class:0:0:0:0 | Generic<? super String> |
|
||||
| test.kt:5:32:5:46 | identity(...) | test.kt:5:3:5:46 | identity2 | test.kt:1:1:13:1 | Generic | test.kt:6:3:6:35 | identity | test.kt:1:1:13:1 | Generic |
|
||||
| test.kt:7:21:7:26 | getStored(...) | test.kt:7:3:7:26 | getter | test.kt:1:1:13:1 | Generic | test.kt:3:3:3:19 | getStored | test.kt:1:1:13:1 | Generic |
|
||||
| test.kt:8:26:8:31 | setStored(...) | test.kt:8:3:8:41 | setter | test.kt:1:1:13:1 | Generic | test.kt:3:3:3:19 | setStored | test.kt:1:1:13:1 | Generic |
|
||||
| test.kt:11:47:11:70 | privateid(...) | test.kt:11:3:11:70 | callPrivateId | test.kt:1:1:13:1 | Generic | file:///!unknown-binary-location/Generic.class:0:0:0:0 | privateid | file:///!unknown-binary-location/Generic.class:0:0:0:0 | Generic<String> |
|
||||
| test.kt:18:13:18:35 | identity(...) | test.kt:15:1:28:1 | user | test.kt:0:0:0:0 | TestKt | file:///!unknown-binary-location/Generic.class:0:0:0:0 | identity | file:///!unknown-binary-location/Generic.class:0:0:0:0 | Generic<String> |
|
||||
| test.kt:19:13:19:36 | identity2(...) | test.kt:15:1:28:1 | user | test.kt:0:0:0:0 | TestKt | file:///!unknown-binary-location/Generic.class:0:0:0:0 | identity2 | file:///!unknown-binary-location/Generic.class:0:0:0:0 | Generic<String> |
|
||||
| test.kt:22:16:22:23 | getter(...) | test.kt:15:1:28:1 | user | test.kt:0:0:0:0 | TestKt | file:///!unknown-binary-location/Generic.class:0:0:0:0 | getter | file:///!unknown-binary-location/Generic.class:0:0:0:0 | Generic<? extends String> |
|
||||
| test.kt:25:15:25:33 | setter(...) | test.kt:15:1:28:1 | user | test.kt:0:0:0:0 | TestKt | file:///!unknown-binary-location/Generic.class:0:0:0:0 | setter | file:///!unknown-binary-location/Generic.class:0:0:0:0 | Generic<? super String> |
|
||||
| test.kt:26:15:26:22 | getter(...) | test.kt:15:1:28:1 | user | test.kt:0:0:0:0 | TestKt | file:///!unknown-binary-location/Generic.class:0:0:0:0 | getter | file:///!unknown-binary-location/Generic.class:0:0:0:0 | Generic<? super String> |
|
||||
constructors
|
||||
| Generic2.class:0:0:0:0 | Generic2<? extends String> | Generic2.class:0:0:0:0 | Generic2<? extends String> | Generic2<? extends String>(<nulltype>) | <nulltype> | void | Test.java:1:7:1:14 | Generic2 | Test.java:3:10:3:17 | Generic2 |
|
||||
| Generic2.class:0:0:0:0 | Generic2<? super String> | Generic2.class:0:0:0:0 | Generic2<? super String> | Generic2<? super String>(java.lang.String) | String | void | Test.java:1:7:1:14 | Generic2 | Test.java:3:10:3:17 | Generic2 |
|
||||
| Generic2.class:0:0:0:0 | Generic2<String> | Generic2.class:0:0:0:0 | Generic2<String> | Generic2<String>(java.lang.String) | String | void | Test.java:1:7:1:14 | Generic2 | Test.java:3:10:3:17 | Generic2 |
|
||||
| Test.java:1:7:1:14 | Generic2 | Test.java:3:10:3:17 | Generic2 | Generic2(java.lang.Object) | T | void | Test.java:1:7:1:14 | Generic2 | Test.java:3:10:3:17 | Generic2 |
|
||||
| Test.java:14:14:14:17 | Test | Test.java:14:14:14:17 | Test | Test() | No parameters | void | Test.java:14:14:14:17 | Test | Test.java:14:14:14:17 | Test |
|
||||
| file:///!unknown-binary-location/Generic.class:0:0:0:0 | Generic<? extends String> | file:///!unknown-binary-location/Generic.class:0:0:0:0 | Generic<? extends String> | Generic<? extends String>(java.lang.Void) | Void | void | test.kt:1:1:10:1 | Generic | test.kt:1:1:10:1 | Generic |
|
||||
| file:///!unknown-binary-location/Generic.class:0:0:0:0 | Generic<? super String> | file:///!unknown-binary-location/Generic.class:0:0:0:0 | Generic<? super String> | Generic<? super String>(java.lang.String) | String | void | test.kt:1:1:10:1 | Generic | test.kt:1:1:10:1 | Generic |
|
||||
| file:///!unknown-binary-location/Generic.class:0:0:0:0 | Generic<String> | file:///!unknown-binary-location/Generic.class:0:0:0:0 | Generic<String> | Generic<String>(java.lang.String) | String | void | test.kt:1:1:10:1 | Generic | test.kt:1:1:10:1 | Generic |
|
||||
| test.kt:1:1:10:1 | Generic | test.kt:1:1:10:1 | Generic | Generic(java.lang.Object) | T | void | test.kt:1:1:10:1 | Generic | test.kt:1:1:10:1 | Generic |
|
||||
| file:///!unknown-binary-location/Generic.class:0:0:0:0 | Generic<? extends String> | file:///!unknown-binary-location/Generic.class:0:0:0:0 | Generic<? extends String> | Generic<? extends String>(java.lang.Void) | Void | void | test.kt:1:1:13:1 | Generic | test.kt:1:1:13:1 | Generic |
|
||||
| file:///!unknown-binary-location/Generic.class:0:0:0:0 | Generic<? super String> | file:///!unknown-binary-location/Generic.class:0:0:0:0 | Generic<? super String> | Generic<? super String>(java.lang.String) | String | void | test.kt:1:1:13:1 | Generic | test.kt:1:1:13:1 | Generic |
|
||||
| file:///!unknown-binary-location/Generic.class:0:0:0:0 | Generic<String> | file:///!unknown-binary-location/Generic.class:0:0:0:0 | Generic<String> | Generic<String>(java.lang.String) | String | void | test.kt:1:1:13:1 | Generic | test.kt:1:1:13:1 | Generic |
|
||||
| test.kt:1:1:13:1 | Generic | test.kt:1:1:13:1 | Generic | Generic(java.lang.Object) | T | void | test.kt:1:1:13:1 | Generic | test.kt:1:1:13:1 | Generic |
|
||||
constructorCalls
|
||||
| Test.java:18:34:18:68 | new Generic2<String>(...) | Generic2.class:0:0:0:0 | Generic2<String> |
|
||||
| test.kt:14:19:14:48 | new Generic<String>(...) | file:///!unknown-binary-location/Generic.class:0:0:0:0 | Generic<String> |
|
||||
| test.kt:17:19:17:48 | new Generic<String>(...) | file:///!unknown-binary-location/Generic.class:0:0:0:0 | Generic<String> |
|
||||
refTypes
|
||||
| Test.java:1:7:1:14 | Generic2 |
|
||||
| Test.java:1:16:1:16 | T |
|
||||
| Test.java:14:14:14:17 | Test |
|
||||
| test.kt:0:0:0:0 | TestKt |
|
||||
| test.kt:1:1:10:1 | Generic |
|
||||
| test.kt:1:1:13:1 | Generic |
|
||||
| test.kt:1:15:1:15 | T |
|
||||
#select
|
||||
| Generic2.class:0:0:0:0 | Generic2<? extends String> | Generic2.class:0:0:0:0 | getter | getter() | No parameters | String | Test.java:1:7:1:14 | Generic2 | Test.java:9:5:9:10 | getter |
|
||||
@@ -51,28 +52,34 @@ refTypes
|
||||
| Test.java:1:7:1:14 | Generic2 | Test.java:9:5:9:10 | getter | getter() | No parameters | T | Test.java:1:7:1:14 | Generic2 | Test.java:9:5:9:10 | getter |
|
||||
| Test.java:1:7:1:14 | Generic2 | Test.java:10:8:10:13 | setter | setter(java.lang.Object) | T | void | Test.java:1:7:1:14 | Generic2 | Test.java:10:8:10:13 | setter |
|
||||
| Test.java:14:14:14:17 | Test | Test.java:16:22:16:25 | user | user() | No parameters | void | Test.java:14:14:14:17 | Test | Test.java:16:22:16:25 | user |
|
||||
| file:///!unknown-binary-location/Generic.class:0:0:0:0 | Generic<? extends String> | file:///!unknown-binary-location/Generic.class:0:0:0:0 | getStored | getStored() | No parameters | String | test.kt:1:1:10:1 | Generic | test.kt:3:3:3:19 | getStored |
|
||||
| file:///!unknown-binary-location/Generic.class:0:0:0:0 | Generic<? extends String> | file:///!unknown-binary-location/Generic.class:0:0:0:0 | getter | getter() | No parameters | String | test.kt:1:1:10:1 | Generic | test.kt:7:3:7:26 | getter |
|
||||
| file:///!unknown-binary-location/Generic.class:0:0:0:0 | Generic<? extends String> | file:///!unknown-binary-location/Generic.class:0:0:0:0 | identity | identity(java.lang.Void) | Void | String | test.kt:1:1:10:1 | Generic | test.kt:6:3:6:35 | identity |
|
||||
| file:///!unknown-binary-location/Generic.class:0:0:0:0 | Generic<? extends String> | file:///!unknown-binary-location/Generic.class:0:0:0:0 | identity2 | identity2(java.lang.Void) | Void | String | test.kt:1:1:10:1 | Generic | test.kt:5:3:5:46 | identity2 |
|
||||
| file:///!unknown-binary-location/Generic.class:0:0:0:0 | Generic<? extends String> | file:///!unknown-binary-location/Generic.class:0:0:0:0 | setStored | setStored(java.lang.Void) | Void | void | test.kt:1:1:10:1 | Generic | test.kt:3:3:3:19 | setStored |
|
||||
| file:///!unknown-binary-location/Generic.class:0:0:0:0 | Generic<? extends String> | file:///!unknown-binary-location/Generic.class:0:0:0:0 | setter | setter(java.lang.Void) | Void | void | test.kt:1:1:10:1 | Generic | test.kt:8:3:8:41 | setter |
|
||||
| file:///!unknown-binary-location/Generic.class:0:0:0:0 | Generic<? super String> | file:///!unknown-binary-location/Generic.class:0:0:0:0 | getStored | getStored() | No parameters | Object | test.kt:1:1:10:1 | Generic | test.kt:3:3:3:19 | getStored |
|
||||
| file:///!unknown-binary-location/Generic.class:0:0:0:0 | Generic<? super String> | file:///!unknown-binary-location/Generic.class:0:0:0:0 | getter | getter() | No parameters | Object | test.kt:1:1:10:1 | Generic | test.kt:7:3:7:26 | getter |
|
||||
| file:///!unknown-binary-location/Generic.class:0:0:0:0 | Generic<? super String> | file:///!unknown-binary-location/Generic.class:0:0:0:0 | identity | identity(java.lang.String) | String | Object | test.kt:1:1:10:1 | Generic | test.kt:6:3:6:35 | identity |
|
||||
| file:///!unknown-binary-location/Generic.class:0:0:0:0 | Generic<? super String> | file:///!unknown-binary-location/Generic.class:0:0:0:0 | identity2 | identity2(java.lang.String) | String | Object | test.kt:1:1:10:1 | Generic | test.kt:5:3:5:46 | identity2 |
|
||||
| file:///!unknown-binary-location/Generic.class:0:0:0:0 | Generic<? super String> | file:///!unknown-binary-location/Generic.class:0:0:0:0 | setStored | setStored(java.lang.String) | String | void | test.kt:1:1:10:1 | Generic | test.kt:3:3:3:19 | setStored |
|
||||
| file:///!unknown-binary-location/Generic.class:0:0:0:0 | Generic<? super String> | file:///!unknown-binary-location/Generic.class:0:0:0:0 | setter | setter(java.lang.String) | String | void | test.kt:1:1:10:1 | Generic | test.kt:8:3:8:41 | setter |
|
||||
| file:///!unknown-binary-location/Generic.class:0:0:0:0 | Generic<String> | file:///!unknown-binary-location/Generic.class:0:0:0:0 | getStored | getStored() | No parameters | String | test.kt:1:1:10:1 | Generic | test.kt:3:3:3:19 | getStored |
|
||||
| file:///!unknown-binary-location/Generic.class:0:0:0:0 | Generic<String> | file:///!unknown-binary-location/Generic.class:0:0:0:0 | getter | getter() | No parameters | String | test.kt:1:1:10:1 | Generic | test.kt:7:3:7:26 | getter |
|
||||
| file:///!unknown-binary-location/Generic.class:0:0:0:0 | Generic<String> | file:///!unknown-binary-location/Generic.class:0:0:0:0 | identity | identity(java.lang.String) | String | String | test.kt:1:1:10:1 | Generic | test.kt:6:3:6:35 | identity |
|
||||
| file:///!unknown-binary-location/Generic.class:0:0:0:0 | Generic<String> | file:///!unknown-binary-location/Generic.class:0:0:0:0 | identity2 | identity2(java.lang.String) | String | String | test.kt:1:1:10:1 | Generic | test.kt:5:3:5:46 | identity2 |
|
||||
| file:///!unknown-binary-location/Generic.class:0:0:0:0 | Generic<String> | file:///!unknown-binary-location/Generic.class:0:0:0:0 | setStored | setStored(java.lang.String) | String | void | test.kt:1:1:10:1 | Generic | test.kt:3:3:3:19 | setStored |
|
||||
| file:///!unknown-binary-location/Generic.class:0:0:0:0 | Generic<String> | file:///!unknown-binary-location/Generic.class:0:0:0:0 | setter | setter(java.lang.String) | String | void | test.kt:1:1:10:1 | Generic | test.kt:8:3:8:41 | setter |
|
||||
| test.kt:0:0:0:0 | TestKt | test.kt:12:1:25:1 | user | user() | No parameters | void | test.kt:0:0:0:0 | TestKt | test.kt:12:1:25:1 | user |
|
||||
| test.kt:1:1:10:1 | Generic | test.kt:3:3:3:19 | getStored | getStored() | No parameters | T | test.kt:1:1:10:1 | Generic | test.kt:3:3:3:19 | getStored |
|
||||
| test.kt:1:1:10:1 | Generic | test.kt:3:3:3:19 | setStored | setStored(java.lang.Object) | T | void | test.kt:1:1:10:1 | Generic | test.kt:3:3:3:19 | setStored |
|
||||
| test.kt:1:1:10:1 | Generic | test.kt:5:3:5:46 | identity2 | identity2(java.lang.Object) | T | T | test.kt:1:1:10:1 | Generic | test.kt:5:3:5:46 | identity2 |
|
||||
| test.kt:1:1:10:1 | Generic | test.kt:6:3:6:35 | identity | identity(java.lang.Object) | T | T | test.kt:1:1:10:1 | Generic | test.kt:6:3:6:35 | identity |
|
||||
| test.kt:1:1:10:1 | Generic | test.kt:7:3:7:26 | getter | getter() | No parameters | T | test.kt:1:1:10:1 | Generic | test.kt:7:3:7:26 | getter |
|
||||
| test.kt:1:1:10:1 | Generic | test.kt:8:3:8:41 | setter | setter(java.lang.Object) | T | void | test.kt:1:1:10:1 | Generic | test.kt:8:3:8:41 | setter |
|
||||
| file:///!unknown-binary-location/Generic.class:0:0:0:0 | Generic<? extends String> | file:///!unknown-binary-location/Generic.class:0:0:0:0 | callPrivateId | callPrivateId(Generic) | Generic<String> | String | test.kt:1:1:13:1 | Generic | test.kt:11:3:11:70 | callPrivateId |
|
||||
| file:///!unknown-binary-location/Generic.class:0:0:0:0 | Generic<? extends String> | file:///!unknown-binary-location/Generic.class:0:0:0:0 | getStored | getStored() | No parameters | String | test.kt:1:1:13:1 | Generic | test.kt:3:3:3:19 | getStored |
|
||||
| file:///!unknown-binary-location/Generic.class:0:0:0:0 | Generic<? extends String> | file:///!unknown-binary-location/Generic.class:0:0:0:0 | getter | getter() | No parameters | String | test.kt:1:1:13:1 | Generic | test.kt:7:3:7:26 | getter |
|
||||
| file:///!unknown-binary-location/Generic.class:0:0:0:0 | Generic<? extends String> | file:///!unknown-binary-location/Generic.class:0:0:0:0 | identity | identity(java.lang.Void) | Void | String | test.kt:1:1:13:1 | Generic | test.kt:6:3:6:35 | identity |
|
||||
| file:///!unknown-binary-location/Generic.class:0:0:0:0 | Generic<? extends String> | file:///!unknown-binary-location/Generic.class:0:0:0:0 | identity2 | identity2(java.lang.Void) | Void | String | test.kt:1:1:13:1 | Generic | test.kt:5:3:5:46 | identity2 |
|
||||
| file:///!unknown-binary-location/Generic.class:0:0:0:0 | Generic<? extends String> | file:///!unknown-binary-location/Generic.class:0:0:0:0 | setStored | setStored(java.lang.Void) | Void | void | test.kt:1:1:13:1 | Generic | test.kt:3:3:3:19 | setStored |
|
||||
| file:///!unknown-binary-location/Generic.class:0:0:0:0 | Generic<? extends String> | file:///!unknown-binary-location/Generic.class:0:0:0:0 | setter | setter(java.lang.Void) | Void | void | test.kt:1:1:13:1 | Generic | test.kt:8:3:8:41 | setter |
|
||||
| file:///!unknown-binary-location/Generic.class:0:0:0:0 | Generic<? super String> | file:///!unknown-binary-location/Generic.class:0:0:0:0 | callPrivateId | callPrivateId(Generic) | Generic<String> | String | test.kt:1:1:13:1 | Generic | test.kt:11:3:11:70 | callPrivateId |
|
||||
| file:///!unknown-binary-location/Generic.class:0:0:0:0 | Generic<? super String> | file:///!unknown-binary-location/Generic.class:0:0:0:0 | getStored | getStored() | No parameters | Object | test.kt:1:1:13:1 | Generic | test.kt:3:3:3:19 | getStored |
|
||||
| file:///!unknown-binary-location/Generic.class:0:0:0:0 | Generic<? super String> | file:///!unknown-binary-location/Generic.class:0:0:0:0 | getter | getter() | No parameters | Object | test.kt:1:1:13:1 | Generic | test.kt:7:3:7:26 | getter |
|
||||
| file:///!unknown-binary-location/Generic.class:0:0:0:0 | Generic<? super String> | file:///!unknown-binary-location/Generic.class:0:0:0:0 | identity | identity(java.lang.String) | String | Object | test.kt:1:1:13:1 | Generic | test.kt:6:3:6:35 | identity |
|
||||
| file:///!unknown-binary-location/Generic.class:0:0:0:0 | Generic<? super String> | file:///!unknown-binary-location/Generic.class:0:0:0:0 | identity2 | identity2(java.lang.String) | String | Object | test.kt:1:1:13:1 | Generic | test.kt:5:3:5:46 | identity2 |
|
||||
| file:///!unknown-binary-location/Generic.class:0:0:0:0 | Generic<? super String> | file:///!unknown-binary-location/Generic.class:0:0:0:0 | setStored | setStored(java.lang.String) | String | void | test.kt:1:1:13:1 | Generic | test.kt:3:3:3:19 | setStored |
|
||||
| file:///!unknown-binary-location/Generic.class:0:0:0:0 | Generic<? super String> | file:///!unknown-binary-location/Generic.class:0:0:0:0 | setter | setter(java.lang.String) | String | void | test.kt:1:1:13:1 | Generic | test.kt:8:3:8:41 | setter |
|
||||
| file:///!unknown-binary-location/Generic.class:0:0:0:0 | Generic<String> | file:///!unknown-binary-location/Generic.class:0:0:0:0 | callPrivateId | callPrivateId(Generic) | Generic<String> | String | test.kt:1:1:13:1 | Generic | test.kt:11:3:11:70 | callPrivateId |
|
||||
| file:///!unknown-binary-location/Generic.class:0:0:0:0 | Generic<String> | file:///!unknown-binary-location/Generic.class:0:0:0:0 | getStored | getStored() | No parameters | String | test.kt:1:1:13:1 | Generic | test.kt:3:3:3:19 | getStored |
|
||||
| file:///!unknown-binary-location/Generic.class:0:0:0:0 | Generic<String> | file:///!unknown-binary-location/Generic.class:0:0:0:0 | getter | getter() | No parameters | String | test.kt:1:1:13:1 | Generic | test.kt:7:3:7:26 | getter |
|
||||
| file:///!unknown-binary-location/Generic.class:0:0:0:0 | Generic<String> | file:///!unknown-binary-location/Generic.class:0:0:0:0 | identity | identity(java.lang.String) | String | String | test.kt:1:1:13:1 | Generic | test.kt:6:3:6:35 | identity |
|
||||
| file:///!unknown-binary-location/Generic.class:0:0:0:0 | Generic<String> | file:///!unknown-binary-location/Generic.class:0:0:0:0 | identity2 | identity2(java.lang.String) | String | String | test.kt:1:1:13:1 | Generic | test.kt:5:3:5:46 | identity2 |
|
||||
| file:///!unknown-binary-location/Generic.class:0:0:0:0 | Generic<String> | file:///!unknown-binary-location/Generic.class:0:0:0:0 | privateid | privateid(java.lang.String) | String | String | test.kt:1:1:13:1 | Generic | test.kt:10:11:10:41 | privateid |
|
||||
| file:///!unknown-binary-location/Generic.class:0:0:0:0 | Generic<String> | file:///!unknown-binary-location/Generic.class:0:0:0:0 | setStored | setStored(java.lang.String) | String | void | test.kt:1:1:13:1 | Generic | test.kt:3:3:3:19 | setStored |
|
||||
| file:///!unknown-binary-location/Generic.class:0:0:0:0 | Generic<String> | file:///!unknown-binary-location/Generic.class:0:0:0:0 | setter | setter(java.lang.String) | String | void | test.kt:1:1:13:1 | Generic | test.kt:8:3:8:41 | setter |
|
||||
| test.kt:0:0:0:0 | TestKt | test.kt:15:1:28:1 | user | user() | No parameters | void | test.kt:0:0:0:0 | TestKt | test.kt:15:1:28:1 | user |
|
||||
| test.kt:1:1:13:1 | Generic | test.kt:3:3:3:19 | getStored | getStored() | No parameters | T | test.kt:1:1:13:1 | Generic | test.kt:3:3:3:19 | getStored |
|
||||
| test.kt:1:1:13:1 | Generic | test.kt:3:3:3:19 | setStored | setStored(java.lang.Object) | T | void | test.kt:1:1:13:1 | Generic | test.kt:3:3:3:19 | setStored |
|
||||
| test.kt:1:1:13:1 | Generic | test.kt:5:3:5:46 | identity2 | identity2(java.lang.Object) | T | T | test.kt:1:1:13:1 | Generic | test.kt:5:3:5:46 | identity2 |
|
||||
| test.kt:1:1:13:1 | Generic | test.kt:6:3:6:35 | identity | identity(java.lang.Object) | T | T | test.kt:1:1:13:1 | Generic | test.kt:6:3:6:35 | identity |
|
||||
| test.kt:1:1:13:1 | Generic | test.kt:7:3:7:26 | getter | getter() | No parameters | T | test.kt:1:1:13:1 | Generic | test.kt:7:3:7:26 | getter |
|
||||
| test.kt:1:1:13:1 | Generic | test.kt:8:3:8:41 | setter | setter(java.lang.Object) | T | void | test.kt:1:1:13:1 | Generic | test.kt:8:3:8:41 | setter |
|
||||
| test.kt:1:1:13:1 | Generic | test.kt:10:11:10:41 | privateid | privateid(java.lang.Object) | T | T | test.kt:1:1:13:1 | Generic | test.kt:10:11:10:41 | privateid |
|
||||
| test.kt:1:1:13:1 | Generic | test.kt:11:3:11:70 | callPrivateId | callPrivateId(Generic) | Generic<String> | String | test.kt:1:1:13:1 | Generic | test.kt:11:3:11:70 | callPrivateId |
|
||||
|
||||
@@ -7,6 +7,9 @@ class Generic<T>(init: T) {
|
||||
fun getter(): T = stored
|
||||
fun setter(param: T) { stored = param }
|
||||
|
||||
private fun privateid(param: T) = param
|
||||
fun callPrivateId(gs: Generic<String>) = gs.privateid("hello world")
|
||||
|
||||
}
|
||||
|
||||
fun user() {
|
||||
@@ -23,5 +26,3 @@ fun user() {
|
||||
projectedIn.getter()
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1,15 +1,33 @@
|
||||
enclosingTypes
|
||||
| file:///!unknown-binary-location/A$<no name provided>.class:0:0:0:0 | new If<T>(...) { ... }<> | file:///!unknown-binary-location/A.class:0:0:0:0 | A<CharSequence> |
|
||||
| file:///!unknown-binary-location/A$<no name provided>.class:0:0:0:0 | new If<T>(...) { ... }<> | file:///!unknown-binary-location/A.class:0:0:0:0 | A<String> |
|
||||
| test.kt:9:18:11:3 | new If<T>(...) { ... } | test.kt:7:1:22:1 | A |
|
||||
| test.kt:13:33:15:3 | new If<T>(...) { ... } | test.kt:7:1:22:1 | A |
|
||||
| test.kt:13:33:15:3 | new If<T>(...) { ... }<> | test.kt:7:1:22:1 | A<> |
|
||||
#select
|
||||
| file:///!unknown-binary-location/A$<no name provided>.class:0:0:0:0 | new If<T>(...) { ... }<> | file:///!unknown-binary-location/A$<no name provided>.class:0:0:0:0 | |
|
||||
| file:///!unknown-binary-location/A$<no name provided>.class:0:0:0:0 | new If<T>(...) { ... }<> | file:///!unknown-binary-location/A$<no name provided>.class:0:0:0:0 | |
|
||||
| file:///!unknown-binary-location/A$<no name provided>.class:0:0:0:0 | new If<T>(...) { ... }<> | file:///!unknown-binary-location/A$<no name provided>.class:0:0:0:0 | getX |
|
||||
| file:///!unknown-binary-location/A$<no name provided>.class:0:0:0:0 | new If<T>(...) { ... }<> | file:///!unknown-binary-location/A$<no name provided>.class:0:0:0:0 | getX |
|
||||
| file:///!unknown-binary-location/A.class:0:0:0:0 | A<CharSequence> | file:///!unknown-binary-location/A.class:0:0:0:0 | A<CharSequence> |
|
||||
| file:///!unknown-binary-location/A.class:0:0:0:0 | A<CharSequence> | file:///!unknown-binary-location/A.class:0:0:0:0 | getAnonType |
|
||||
| file:///!unknown-binary-location/A.class:0:0:0:0 | A<CharSequence> | file:///!unknown-binary-location/A.class:0:0:0:0 | getPrivateAnonType$private |
|
||||
| file:///!unknown-binary-location/A.class:0:0:0:0 | A<CharSequence> | file:///!unknown-binary-location/A.class:0:0:0:0 | privateUser |
|
||||
| file:///!unknown-binary-location/A.class:0:0:0:0 | A<String> | file:///!unknown-binary-location/A.class:0:0:0:0 | A<String> |
|
||||
| file:///!unknown-binary-location/A.class:0:0:0:0 | A<String> | file:///!unknown-binary-location/A.class:0:0:0:0 | getAnonType |
|
||||
| file:///!unknown-binary-location/A.class:0:0:0:0 | A<String> | file:///!unknown-binary-location/A.class:0:0:0:0 | getPrivateAnonType$private |
|
||||
| file:///!unknown-binary-location/A.class:0:0:0:0 | A<String> | file:///!unknown-binary-location/A.class:0:0:0:0 | privateUser |
|
||||
| file:///!unknown-binary-location/If.class:0:0:0:0 | If<String> | file:///!unknown-binary-location/If.class:0:0:0:0 | getX |
|
||||
| file:///!unknown-binary-location/If.class:0:0:0:0 | If<T> | file:///!unknown-binary-location/If.class:0:0:0:0 | getX |
|
||||
| other.kt:1:1:1:34 | Ext | other.kt:1:1:1:34 | Ext |
|
||||
| test.kt:0:0:0:0 | TestKt | test.kt:19:1:19:38 | user |
|
||||
| test.kt:0:0:0:0 | TestKt | test.kt:24:1:24:38 | user |
|
||||
| test.kt:1:1:5:1 | If | test.kt:3:3:3:11 | getX |
|
||||
| test.kt:7:1:17:1 | A | test.kt:7:6:17:1 | A |
|
||||
| test.kt:7:1:17:1 | A | test.kt:9:3:11:3 | anonType |
|
||||
| test.kt:7:1:17:1 | A | test.kt:9:3:11:3 | getAnonType |
|
||||
| test.kt:7:1:17:1 | A | test.kt:13:3:15:3 | privateAnonType |
|
||||
| test.kt:7:1:17:1 | A | test.kt:13:11:15:3 | getPrivateAnonType$private |
|
||||
| test.kt:7:1:22:1 | A | test.kt:7:6:22:1 | A |
|
||||
| test.kt:7:1:22:1 | A | test.kt:9:3:11:3 | anonType |
|
||||
| test.kt:7:1:22:1 | A | test.kt:9:3:11:3 | getAnonType |
|
||||
| test.kt:7:1:22:1 | A | test.kt:13:3:15:3 | privateAnonType |
|
||||
| test.kt:7:1:22:1 | A | test.kt:13:11:15:3 | getPrivateAnonType$private |
|
||||
| test.kt:7:1:22:1 | A | test.kt:17:3:20:3 | privateUser |
|
||||
| test.kt:9:18:11:3 | new If<T>(...) { ... } | test.kt:9:18:11:3 | |
|
||||
| test.kt:9:18:11:3 | new If<T>(...) { ... } | test.kt:10:5:10:22 | x |
|
||||
| test.kt:9:18:11:3 | new If<T>(...) { ... } | test.kt:10:14:10:22 | getX |
|
||||
|
||||
@@ -14,6 +14,11 @@ open class A<T>(t: T) {
|
||||
override val x = t
|
||||
}
|
||||
|
||||
fun privateUser(x: A<String>, y: A<CharSequence>) {
|
||||
val a = x.privateAnonType.x
|
||||
val b = y.privateAnonType.x
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
fun user(x: A<String>) = x.anonType.x
|
||||
|
||||
@@ -3,3 +3,7 @@ import java
|
||||
from ClassOrInterface ci, Member m
|
||||
where m = ci.getAMember() and ci.getSourceDeclaration().fromSource()
|
||||
select ci, m
|
||||
|
||||
query predicate enclosingTypes(NestedType nt, Type encl) {
|
||||
nt.getSourceDeclaration().fromSource() and encl = nt.getEnclosingType()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user