diff --git a/java/kotlin-extractor/src/main/kotlin/KotlinFileExtractor.kt b/java/kotlin-extractor/src/main/kotlin/KotlinFileExtractor.kt index 530318ec3b0..da46483e7ec 100644 --- a/java/kotlin-extractor/src/main/kotlin/KotlinFileExtractor.kt +++ b/java/kotlin-extractor/src/main/kotlin/KotlinFileExtractor.kt @@ -3123,6 +3123,70 @@ open class KotlinFileExtractor( return tw.getLocation(ktProperty.valOrVarKeyword.startOffset, ktProperty.endOffset) } + /** + * For a synthetic `thisRef` argument in a compiler-generated *delegated*-property accessor + * body (origin `DELEGATED_PROPERTY_ACCESSOR`), returns the location to use, or null to leave + * the raw location in place. + * + * The synthesised getter/setter body forwards to the delegate's `getValue`/`setValue`, + * passing the accessor's dispatch/extension receiver (a `this` access) as the `thisRef` + * argument, or `null` when the property has no receiver (e.g. a local delegated property). + * These arguments have no dedicated source token. The K2 frontend records them so that: + * - a receiver `this` access takes the delegate *expression*'s source range (e.g. the + * `ResourceDelegate()` in `by ResourceDelegate()`), and + * - a `null` argument has undefined offsets, so `tw.getLocation` maps it to the whole-file + * location (`file:0:0:0:0`). + * + * The K1 frontend instead gives both real-but-meaningless offsets that resolve (via + * `findPsiElement`) to an unrelated token near the top of the file (e.g. an `import`), + * producing a bogus non-zero location. Recognise these arguments by their enclosing accessor's + * origin, their shape (the accessor's own dispatch/extension receiver, or a `null` constant), + * and the fact that their offsets fall outside the enclosing property's PSI text range (a real + * receiver access could only occur within the delegate expression, i.e. inside that range). + * Emit the K2-native location so K1 converges: the delegate expression's range for a `this` + * receiver, or the whole-file location for `null`. + * + * This is not gated on [usesK2]: it must fire under K1 (which retains PSI and produces the + * bogus offsets) and is a no-op under K2 (where [getPsi2Ir] is null, so it returns null and + * the raw location is already used). + */ + private fun getDelegatedAccessorSyntheticArgumentLocation(e: IrElement): Label? { + val enclosing = declarationStack.peek().first as? IrFunction ?: return null + if (enclosing.origin != IrDeclarationOrigin.DELEGATED_PROPERTY_ACCESSOR) return null + val isNull = + when (e) { + is IrGetValue -> { + val owner = e.symbol.owner + val isReceiver = + owner is IrValueParameter && + owner.parent == enclosing && + (isDispatchReceiver(owner) || + owner == enclosing.codeQlExtensionReceiverParameter) + if (!isReceiver) return null + false + } + is CodeQLIrConst<*> -> { + if (e.value != null) return null + true + } + else -> return null + } + val file = currentIrFile ?: return null + val psiElement = getPsi2Ir()?.findPsiElement(enclosing, file) ?: return null + val ktProperty = generateSequence(psiElement) { it.parent } + .filterIsInstance().firstOrNull() + ?: return null + val start = e.startOffset + val end = e.endOffset + if (start < 0 || end < 0) return null + // In-range offsets could be a genuine receiver access within the delegate expression; + // only treat offsets outside the whole property declaration as the synthetic thisRef. + if (start >= ktProperty.startOffset && end <= ktProperty.endOffset) return null + if (isNull) return tw.getWholeFileLocation() + val delegateExpression = ktProperty.delegate?.expression ?: return null + return tw.getLocation(delegateExpression.startOffset, delegateExpression.endOffset) + } + /** * For a delegated-property accessor (origin `DELEGATED_PROPERTY_ACCESSOR`), returns the * offset remapping to apply while extracting its body, or null if it cannot be computed. @@ -6461,7 +6525,8 @@ open class KotlinFileExtractor( extractVariableAccess( useValueDeclaration(owner), extractType, - getPsiBasedLocation(e) ?: tw.getLocation(e), + getDelegatedAccessorSyntheticArgumentLocation(e) + ?: getPsiBasedLocation(e) ?: tw.getLocation(e), exprParent.parent, exprParent.idx, callable, @@ -7012,7 +7077,8 @@ open class KotlinFileExtractor( callable: Label ) { val containingDeclaration = declarationStack.peek().first - val locId = getPsiBasedLocation(e) ?: tw.getLocation(e) + val locId = getDelegatedAccessorSyntheticArgumentLocation(e) + ?: getPsiBasedLocation(e) ?: tw.getLocation(e) if ( containingDeclaration.shouldExtractAsStatic && @@ -7389,7 +7455,7 @@ open class KotlinFileExtractor( v == null -> { extractNull( e.type, - tw.getLocation(e), + getDelegatedAccessorSyntheticArgumentLocation(e) ?: tw.getLocation(e), parent, idx, enclosingCallable, diff --git a/java/ql/test-kotlin1/library-tests/exprs/PrintAst.expected b/java/ql/test-kotlin1/library-tests/exprs/PrintAst.expected index 9d7969d45a8..806a4f1ecc8 100644 --- a/java/ql/test-kotlin1/library-tests/exprs/PrintAst.expected +++ b/java/ql/test-kotlin1/library-tests/exprs/PrintAst.expected @@ -33,7 +33,7 @@ delegatedProperties.kt: # 87| -1: [TypeAccess] PropertyReferenceDelegatesKt # 87| 0: [VarAccess] DelegatedPropertiesKt.extDelegated$delegateMyClass # 87| -1: [TypeAccess] DelegatedPropertiesKt -# 1| 1: [ExtensionReceiverAccess] this +# 87| 1: [ExtensionReceiverAccess] this # 87| 2: [PropertyRefExpr] ...::... # 87| -4: [AnonymousClass] new KMutableProperty1(...) { ... } # 87| 1: [Constructor] @@ -82,7 +82,7 @@ delegatedProperties.kt: # 87| -1: [TypeAccess] PropertyReferenceDelegatesKt # 87| 0: [VarAccess] DelegatedPropertiesKt.extDelegated$delegateMyClass # 87| -1: [TypeAccess] DelegatedPropertiesKt -# 1| 1: [ExtensionReceiverAccess] this +# 87| 1: [ExtensionReceiverAccess] this # 87| 2: [PropertyRefExpr] ...::... # 87| -4: [AnonymousClass] new KMutableProperty1(...) { ... } # 87| 1: [Constructor] @@ -644,7 +644,7 @@ delegatedProperties.kt: # 42| 0: [MethodCall] getValue(...) # 42| -1: [VarAccess] this.varResource0$delegate # 42| -1: [ThisAccess] this -# 1| 0: [ThisAccess] this +# 42| 0: [ThisAccess] this # 42| 1: [PropertyRefExpr] ...::... # 42| -4: [AnonymousClass] new KMutableProperty1(...) { ... } # 42| 1: [Constructor] @@ -687,7 +687,7 @@ delegatedProperties.kt: # 42| 0: [MethodCall] setValue(...) # 42| -1: [VarAccess] this.varResource0$delegate # 42| -1: [ThisAccess] this -# 1| 0: [ThisAccess] this +# 42| 0: [ThisAccess] this # 42| 1: [PropertyRefExpr] ...::... # 42| -4: [AnonymousClass] new KMutableProperty1(...) { ... } # 42| 1: [Constructor] @@ -891,7 +891,7 @@ delegatedProperties.kt: # 66| -1: [TypeAccess] PropertyReferenceDelegatesKt # 66| 0: [VarAccess] this.delegatedToMember1$delegate # 66| -1: [ThisAccess] this -# 1| 1: [ThisAccess] this +# 66| 1: [ThisAccess] this # 66| 2: [PropertyRefExpr] ...::... # 66| -4: [AnonymousClass] new KMutableProperty1(...) { ... } # 66| 1: [Constructor] @@ -936,7 +936,7 @@ delegatedProperties.kt: # 66| -1: [TypeAccess] PropertyReferenceDelegatesKt # 66| 0: [VarAccess] this.delegatedToMember1$delegate # 66| -1: [ThisAccess] this -# 1| 1: [ThisAccess] this +# 66| 1: [ThisAccess] this # 66| 2: [PropertyRefExpr] ...::... # 66| -4: [AnonymousClass] new KMutableProperty1(...) { ... } # 66| 1: [Constructor] @@ -1021,7 +1021,7 @@ delegatedProperties.kt: # 67| -1: [TypeAccess] PropertyReferenceDelegatesKt # 67| 0: [VarAccess] this.delegatedToMember2$delegate # 67| -1: [ThisAccess] this -# 1| 1: [ThisAccess] this +# 67| 1: [ThisAccess] this # 67| 2: [PropertyRefExpr] ...::... # 67| -4: [AnonymousClass] new KMutableProperty1(...) { ... } # 67| 1: [Constructor] @@ -1067,7 +1067,7 @@ delegatedProperties.kt: # 67| -1: [TypeAccess] PropertyReferenceDelegatesKt # 67| 0: [VarAccess] this.delegatedToMember2$delegate # 67| -1: [ThisAccess] this -# 1| 1: [ThisAccess] this +# 67| 1: [ThisAccess] this # 67| 2: [PropertyRefExpr] ...::... # 67| -4: [AnonymousClass] new KMutableProperty1(...) { ... } # 67| 1: [Constructor] @@ -1146,7 +1146,7 @@ delegatedProperties.kt: # 69| -1: [TypeAccess] PropertyReferenceDelegatesKt # 69| 0: [VarAccess] this.delegatedToExtMember1$delegate # 69| -1: [ThisAccess] this -# 1| 1: [ThisAccess] this +# 69| 1: [ThisAccess] this # 69| 2: [PropertyRefExpr] ...::... # 69| -4: [AnonymousClass] new KMutableProperty1(...) { ... } # 69| 1: [Constructor] @@ -1191,7 +1191,7 @@ delegatedProperties.kt: # 69| -1: [TypeAccess] PropertyReferenceDelegatesKt # 69| 0: [VarAccess] this.delegatedToExtMember1$delegate # 69| -1: [ThisAccess] this -# 1| 1: [ThisAccess] this +# 69| 1: [ThisAccess] this # 69| 2: [PropertyRefExpr] ...::... # 69| -4: [AnonymousClass] new KMutableProperty1(...) { ... } # 69| 1: [Constructor] @@ -1278,7 +1278,7 @@ delegatedProperties.kt: # 70| -1: [TypeAccess] PropertyReferenceDelegatesKt # 70| 0: [VarAccess] this.delegatedToExtMember2$delegate # 70| -1: [ThisAccess] this -# 1| 1: [ThisAccess] this +# 70| 1: [ThisAccess] this # 70| 2: [PropertyRefExpr] ...::... # 70| -4: [AnonymousClass] new KMutableProperty1(...) { ... } # 70| 1: [Constructor] @@ -1324,7 +1324,7 @@ delegatedProperties.kt: # 70| -1: [TypeAccess] PropertyReferenceDelegatesKt # 70| 0: [VarAccess] this.delegatedToExtMember2$delegate # 70| -1: [ThisAccess] this -# 1| 1: [ThisAccess] this +# 70| 1: [ThisAccess] this # 70| 2: [PropertyRefExpr] ...::... # 70| -4: [AnonymousClass] new KMutableProperty1(...) { ... } # 70| 1: [Constructor] @@ -1405,7 +1405,7 @@ delegatedProperties.kt: # 72| -1: [TypeAccess] PropertyReferenceDelegatesKt # 72| 0: [VarAccess] this.delegatedToBaseClass1$delegate # 72| -1: [ThisAccess] this -# 1| 1: [ThisAccess] this +# 72| 1: [ThisAccess] this # 72| 2: [PropertyRefExpr] ...::... # 72| -4: [AnonymousClass] new KProperty1(...) { ... } # 72| 1: [Constructor] @@ -1471,7 +1471,7 @@ delegatedProperties.kt: # 73| -1: [TypeAccess] PropertyReferenceDelegatesKt # 73| 0: [VarAccess] this.delegatedToBaseClass2$delegate # 73| -1: [ThisAccess] this -# 1| 1: [ThisAccess] this +# 73| 1: [ThisAccess] this # 73| 2: [PropertyRefExpr] ...::... # 73| -4: [AnonymousClass] new KProperty1(...) { ... } # 73| 1: [Constructor] @@ -1531,7 +1531,7 @@ delegatedProperties.kt: # 75| -1: [TypeAccess] PropertyReferenceDelegatesKt # 75| 0: [VarAccess] this.delegatedToAnotherClass1$delegate # 75| -1: [ThisAccess] this -# 1| 1: [ThisAccess] this +# 75| 1: [ThisAccess] this # 75| 2: [PropertyRefExpr] ...::... # 75| -4: [AnonymousClass] new KProperty1(...) { ... } # 75| 1: [Constructor] @@ -1597,7 +1597,7 @@ delegatedProperties.kt: # 77| -1: [TypeAccess] PropertyReferenceDelegatesKt # 77| 0: [VarAccess] this.delegatedToTopLevel$delegate # 77| -1: [ThisAccess] this -# 1| 1: [ThisAccess] this +# 77| 1: [ThisAccess] this # 77| 2: [PropertyRefExpr] ...::... # 77| -4: [AnonymousClass] new KMutableProperty1(...) { ... } # 77| 1: [Constructor] @@ -1642,7 +1642,7 @@ delegatedProperties.kt: # 77| -1: [TypeAccess] PropertyReferenceDelegatesKt # 77| 0: [VarAccess] this.delegatedToTopLevel$delegate # 77| -1: [ThisAccess] this -# 1| 1: [ThisAccess] this +# 77| 1: [ThisAccess] this # 77| 2: [PropertyRefExpr] ...::... # 77| -4: [AnonymousClass] new KMutableProperty1(...) { ... } # 77| 1: [Constructor] @@ -1713,7 +1713,7 @@ delegatedProperties.kt: # 79| -1: [TypeAccess] PropertyReferenceDelegatesKt # 79| 0: [VarAccess] this.max$delegate # 79| -1: [ThisAccess] this -# 1| 1: [ThisAccess] this +# 79| 1: [ThisAccess] this # 79| 2: [PropertyRefExpr] ...::... # 79| -4: [AnonymousClass] new KProperty1(...) { ... } # 79| 1: [Constructor] diff --git a/java/ql/test-kotlin1/library-tests/exprs/exprs.expected b/java/ql/test-kotlin1/library-tests/exprs/exprs.expected index 7ea31683043..0b70fba8896 100644 --- a/java/ql/test-kotlin1/library-tests/exprs/exprs.expected +++ b/java/ql/test-kotlin1/library-tests/exprs/exprs.expected @@ -9,24 +9,6 @@ | delegatedProperties.kt:0:0:0:0 | null | delegatedProperties.kt:82:9:82:54 | | NullLiteral | | delegatedProperties.kt:0:0:0:0 | null | delegatedProperties.kt:82:9:82:54 | | NullLiteral | | delegatedProperties.kt:1:9:1:12 | null | delegatedProperties.kt:18:5:40:5 | fn | NullLiteral | -| delegatedProperties.kt:1:9:1:12 | this | delegatedProperties.kt:42:5:42:47 | getVarResource0 | ThisAccess | -| delegatedProperties.kt:1:9:1:12 | this | delegatedProperties.kt:42:5:42:47 | setVarResource0 | ThisAccess | -| delegatedProperties.kt:1:9:1:12 | this | delegatedProperties.kt:66:5:66:50 | getDelegatedToMember1 | ThisAccess | -| delegatedProperties.kt:1:9:1:12 | this | delegatedProperties.kt:66:5:66:50 | setDelegatedToMember1 | ThisAccess | -| delegatedProperties.kt:1:9:1:12 | this | delegatedProperties.kt:67:5:67:53 | getDelegatedToMember2 | ThisAccess | -| delegatedProperties.kt:1:9:1:12 | this | delegatedProperties.kt:67:5:67:53 | setDelegatedToMember2 | ThisAccess | -| delegatedProperties.kt:1:9:1:12 | this | delegatedProperties.kt:69:5:69:56 | getDelegatedToExtMember1 | ThisAccess | -| delegatedProperties.kt:1:9:1:12 | this | delegatedProperties.kt:69:5:69:56 | setDelegatedToExtMember1 | ThisAccess | -| delegatedProperties.kt:1:9:1:12 | this | delegatedProperties.kt:70:5:70:59 | getDelegatedToExtMember2 | ThisAccess | -| delegatedProperties.kt:1:9:1:12 | this | delegatedProperties.kt:70:5:70:59 | setDelegatedToExtMember2 | ThisAccess | -| delegatedProperties.kt:1:9:1:12 | this | delegatedProperties.kt:72:5:72:56 | getDelegatedToBaseClass1 | ThisAccess | -| delegatedProperties.kt:1:9:1:12 | this | delegatedProperties.kt:73:5:73:56 | getDelegatedToBaseClass2 | ThisAccess | -| delegatedProperties.kt:1:9:1:12 | this | delegatedProperties.kt:75:5:75:78 | getDelegatedToAnotherClass1 | ThisAccess | -| delegatedProperties.kt:1:9:1:12 | this | delegatedProperties.kt:77:5:77:49 | getDelegatedToTopLevel | ThisAccess | -| delegatedProperties.kt:1:9:1:12 | this | delegatedProperties.kt:77:5:77:49 | setDelegatedToTopLevel | ThisAccess | -| delegatedProperties.kt:1:9:1:12 | this | delegatedProperties.kt:79:5:79:38 | getMax | ThisAccess | -| delegatedProperties.kt:1:9:1:12 | this | delegatedProperties.kt:87:1:87:46 | getExtDelegated | ExtensionReceiverAccess | -| delegatedProperties.kt:1:9:1:12 | this | delegatedProperties.kt:87:1:87:46 | setExtDelegated | ExtensionReceiverAccess | | delegatedProperties.kt:5:5:12:5 | Unit | file://:0:0:0:0 | | TypeAccess | | delegatedProperties.kt:6:9:9:9 | int | file://:0:0:0:0 | | TypeAccess | | delegatedProperties.kt:6:9:9:9 | prop1$delegate | delegatedProperties.kt:5:5:12:5 | fn | LocalVariableDeclExpr | @@ -276,6 +258,8 @@ | delegatedProperties.kt:42:30:42:47 | setVarResource0(...) | delegatedProperties.kt:42:30:42:47 | set | MethodCall | | delegatedProperties.kt:42:30:42:47 | setVarResource0(...) | delegatedProperties.kt:42:30:42:47 | set | MethodCall | | delegatedProperties.kt:42:30:42:47 | this | delegatedProperties.kt:42:5:42:47 | getVarResource0 | ThisAccess | +| delegatedProperties.kt:42:30:42:47 | this | delegatedProperties.kt:42:5:42:47 | getVarResource0 | ThisAccess | +| delegatedProperties.kt:42:30:42:47 | this | delegatedProperties.kt:42:5:42:47 | setVarResource0 | ThisAccess | | delegatedProperties.kt:42:30:42:47 | this | delegatedProperties.kt:42:5:42:47 | setVarResource0 | ThisAccess | | delegatedProperties.kt:42:30:42:47 | this | delegatedProperties.kt:42:30:42:47 | invoke | ThisAccess | | delegatedProperties.kt:42:30:42:47 | this | delegatedProperties.kt:42:30:42:47 | invoke | ThisAccess | @@ -399,6 +383,8 @@ | delegatedProperties.kt:66:36:66:50 | setMemberInt(...) | delegatedProperties.kt:66:36:66:50 | set | MethodCall | | delegatedProperties.kt:66:36:66:50 | setValue(...) | delegatedProperties.kt:66:5:66:50 | setDelegatedToMember1 | MethodCall | | delegatedProperties.kt:66:36:66:50 | this | delegatedProperties.kt:66:5:66:50 | getDelegatedToMember1 | ThisAccess | +| delegatedProperties.kt:66:36:66:50 | this | delegatedProperties.kt:66:5:66:50 | getDelegatedToMember1 | ThisAccess | +| delegatedProperties.kt:66:36:66:50 | this | delegatedProperties.kt:66:5:66:50 | setDelegatedToMember1 | ThisAccess | | delegatedProperties.kt:66:36:66:50 | this | delegatedProperties.kt:66:5:66:50 | setDelegatedToMember1 | ThisAccess | | delegatedProperties.kt:66:36:66:50 | this | delegatedProperties.kt:66:36:66:50 | | ThisAccess | | delegatedProperties.kt:66:36:66:50 | this | delegatedProperties.kt:66:36:66:50 | get | ThisAccess | @@ -462,6 +448,8 @@ | delegatedProperties.kt:67:36:67:53 | setMemberInt(...) | delegatedProperties.kt:67:36:67:53 | set | MethodCall | | delegatedProperties.kt:67:36:67:53 | setValue(...) | delegatedProperties.kt:67:5:67:53 | setDelegatedToMember2 | MethodCall | | delegatedProperties.kt:67:36:67:53 | this | delegatedProperties.kt:67:5:67:53 | getDelegatedToMember2 | ThisAccess | +| delegatedProperties.kt:67:36:67:53 | this | delegatedProperties.kt:67:5:67:53 | getDelegatedToMember2 | ThisAccess | +| delegatedProperties.kt:67:36:67:53 | this | delegatedProperties.kt:67:5:67:53 | setDelegatedToMember2 | ThisAccess | | delegatedProperties.kt:67:36:67:53 | this | delegatedProperties.kt:67:5:67:53 | setDelegatedToMember2 | ThisAccess | | delegatedProperties.kt:67:36:67:53 | this | delegatedProperties.kt:67:36:67:53 | invoke | ThisAccess | | delegatedProperties.kt:67:36:67:53 | this | delegatedProperties.kt:67:36:67:53 | invoke | ThisAccess | @@ -519,6 +507,8 @@ | delegatedProperties.kt:69:39:69:56 | setExtDelegated(...) | delegatedProperties.kt:69:39:69:56 | set | MethodCall | | delegatedProperties.kt:69:39:69:56 | setValue(...) | delegatedProperties.kt:69:5:69:56 | setDelegatedToExtMember1 | MethodCall | | delegatedProperties.kt:69:39:69:56 | this | delegatedProperties.kt:69:5:69:56 | getDelegatedToExtMember1 | ThisAccess | +| delegatedProperties.kt:69:39:69:56 | this | delegatedProperties.kt:69:5:69:56 | getDelegatedToExtMember1 | ThisAccess | +| delegatedProperties.kt:69:39:69:56 | this | delegatedProperties.kt:69:5:69:56 | setDelegatedToExtMember1 | ThisAccess | | delegatedProperties.kt:69:39:69:56 | this | delegatedProperties.kt:69:5:69:56 | setDelegatedToExtMember1 | ThisAccess | | delegatedProperties.kt:69:39:69:56 | this | delegatedProperties.kt:69:39:69:56 | | ThisAccess | | delegatedProperties.kt:69:39:69:56 | this | delegatedProperties.kt:69:39:69:56 | get | ThisAccess | @@ -584,6 +574,8 @@ | delegatedProperties.kt:70:39:70:59 | setExtDelegated(...) | delegatedProperties.kt:70:39:70:59 | set | MethodCall | | delegatedProperties.kt:70:39:70:59 | setValue(...) | delegatedProperties.kt:70:5:70:59 | setDelegatedToExtMember2 | MethodCall | | delegatedProperties.kt:70:39:70:59 | this | delegatedProperties.kt:70:5:70:59 | getDelegatedToExtMember2 | ThisAccess | +| delegatedProperties.kt:70:39:70:59 | this | delegatedProperties.kt:70:5:70:59 | getDelegatedToExtMember2 | ThisAccess | +| delegatedProperties.kt:70:39:70:59 | this | delegatedProperties.kt:70:5:70:59 | setDelegatedToExtMember2 | ThisAccess | | delegatedProperties.kt:70:39:70:59 | this | delegatedProperties.kt:70:5:70:59 | setDelegatedToExtMember2 | ThisAccess | | delegatedProperties.kt:70:39:70:59 | this | delegatedProperties.kt:70:39:70:59 | invoke | ThisAccess | | delegatedProperties.kt:70:39:70:59 | this | delegatedProperties.kt:70:39:70:59 | invoke | ThisAccess | @@ -617,6 +609,7 @@ | delegatedProperties.kt:72:39:72:56 | getDelegatedToBaseClass1(...) | delegatedProperties.kt:72:39:72:56 | get | MethodCall | | delegatedProperties.kt:72:39:72:56 | getValue(...) | delegatedProperties.kt:72:5:72:56 | getDelegatedToBaseClass1 | MethodCall | | delegatedProperties.kt:72:39:72:56 | this | delegatedProperties.kt:72:5:72:56 | getDelegatedToBaseClass1 | ThisAccess | +| delegatedProperties.kt:72:39:72:56 | this | delegatedProperties.kt:72:5:72:56 | getDelegatedToBaseClass1 | ThisAccess | | delegatedProperties.kt:72:39:72:56 | this | delegatedProperties.kt:72:39:72:56 | | ThisAccess | | delegatedProperties.kt:72:39:72:56 | this | delegatedProperties.kt:72:39:72:56 | get | ThisAccess | | delegatedProperties.kt:72:39:72:56 | this | delegatedProperties.kt:72:39:72:56 | invoke | ThisAccess | @@ -651,6 +644,7 @@ | delegatedProperties.kt:73:39:73:56 | getDelegatedToBaseClass2(...) | delegatedProperties.kt:73:39:73:56 | get | MethodCall | | delegatedProperties.kt:73:39:73:56 | getValue(...) | delegatedProperties.kt:73:5:73:56 | getDelegatedToBaseClass2 | MethodCall | | delegatedProperties.kt:73:39:73:56 | this | delegatedProperties.kt:73:5:73:56 | getDelegatedToBaseClass2 | ThisAccess | +| delegatedProperties.kt:73:39:73:56 | this | delegatedProperties.kt:73:5:73:56 | getDelegatedToBaseClass2 | ThisAccess | | delegatedProperties.kt:73:39:73:56 | this | delegatedProperties.kt:73:39:73:56 | invoke | ThisAccess | | delegatedProperties.kt:73:39:73:56 | this | delegatedProperties.kt:73:39:73:56 | invoke | ThisAccess | | delegatedProperties.kt:73:39:73:56 | this.delegatedToBaseClass2$delegate | delegatedProperties.kt:73:5:73:56 | getDelegatedToBaseClass2 | VarAccess | @@ -682,6 +676,7 @@ | delegatedProperties.kt:75:42:75:78 | getDelegatedToAnotherClass1(...) | delegatedProperties.kt:75:42:75:78 | get | MethodCall | | delegatedProperties.kt:75:42:75:78 | getValue(...) | delegatedProperties.kt:75:5:75:78 | getDelegatedToAnotherClass1 | MethodCall | | delegatedProperties.kt:75:42:75:78 | this | delegatedProperties.kt:75:5:75:78 | getDelegatedToAnotherClass1 | ThisAccess | +| delegatedProperties.kt:75:42:75:78 | this | delegatedProperties.kt:75:5:75:78 | getDelegatedToAnotherClass1 | ThisAccess | | delegatedProperties.kt:75:42:75:78 | this | delegatedProperties.kt:75:42:75:78 | | ThisAccess | | delegatedProperties.kt:75:42:75:78 | this | delegatedProperties.kt:75:42:75:78 | get | ThisAccess | | delegatedProperties.kt:75:42:75:78 | this | delegatedProperties.kt:75:42:75:78 | invoke | ThisAccess | @@ -735,6 +730,8 @@ | delegatedProperties.kt:77:37:77:49 | setTopLevelInt(...) | delegatedProperties.kt:77:37:77:49 | set | MethodCall | | delegatedProperties.kt:77:37:77:49 | setValue(...) | delegatedProperties.kt:77:5:77:49 | setDelegatedToTopLevel | MethodCall | | delegatedProperties.kt:77:37:77:49 | this | delegatedProperties.kt:77:5:77:49 | getDelegatedToTopLevel | ThisAccess | +| delegatedProperties.kt:77:37:77:49 | this | delegatedProperties.kt:77:5:77:49 | getDelegatedToTopLevel | ThisAccess | +| delegatedProperties.kt:77:37:77:49 | this | delegatedProperties.kt:77:5:77:49 | setDelegatedToTopLevel | ThisAccess | | delegatedProperties.kt:77:37:77:49 | this | delegatedProperties.kt:77:5:77:49 | setDelegatedToTopLevel | ThisAccess | | delegatedProperties.kt:77:37:77:49 | this | delegatedProperties.kt:77:37:77:49 | invoke | ThisAccess | | delegatedProperties.kt:77:37:77:49 | this | delegatedProperties.kt:77:37:77:49 | invoke | ThisAccess | @@ -763,6 +760,7 @@ | delegatedProperties.kt:79:21:79:38 | getMax(...) | delegatedProperties.kt:79:21:79:38 | get | MethodCall | | delegatedProperties.kt:79:21:79:38 | getValue(...) | delegatedProperties.kt:79:5:79:38 | getMax | MethodCall | | delegatedProperties.kt:79:21:79:38 | this | delegatedProperties.kt:79:5:79:38 | getMax | ThisAccess | +| delegatedProperties.kt:79:21:79:38 | this | delegatedProperties.kt:79:5:79:38 | getMax | ThisAccess | | delegatedProperties.kt:79:21:79:38 | this | delegatedProperties.kt:79:21:79:38 | invoke | ThisAccess | | delegatedProperties.kt:79:21:79:38 | this | delegatedProperties.kt:79:21:79:38 | invoke | ThisAccess | | delegatedProperties.kt:79:21:79:38 | this.max$delegate | delegatedProperties.kt:79:5:79:38 | getMax | VarAccess | @@ -880,6 +878,8 @@ | delegatedProperties.kt:87:34:87:46 | setExtDelegated(...) | delegatedProperties.kt:87:34:87:46 | set | MethodCall | | delegatedProperties.kt:87:34:87:46 | setTopLevelInt(...) | delegatedProperties.kt:87:34:87:46 | set | MethodCall | | delegatedProperties.kt:87:34:87:46 | setValue(...) | delegatedProperties.kt:87:1:87:46 | setExtDelegated | MethodCall | +| delegatedProperties.kt:87:34:87:46 | this | delegatedProperties.kt:87:1:87:46 | getExtDelegated | ExtensionReceiverAccess | +| delegatedProperties.kt:87:34:87:46 | this | delegatedProperties.kt:87:1:87:46 | setExtDelegated | ExtensionReceiverAccess | | delegatedProperties.kt:87:34:87:46 | this | delegatedProperties.kt:87:34:87:46 | invoke | ThisAccess | | delegatedProperties.kt:87:34:87:46 | this | delegatedProperties.kt:87:34:87:46 | invoke | ThisAccess | | delegatedProperties.kt:87:34:87:46 | this | delegatedProperties.kt:87:34:87:46 | invoke | ThisAccess | diff --git a/java/ql/test-kotlin1/library-tests/methods/exprs.expected b/java/ql/test-kotlin1/library-tests/methods/exprs.expected index 2604df7fcb0..a9ef1d52098 100644 --- a/java/ql/test-kotlin1/library-tests/methods/exprs.expected +++ b/java/ql/test-kotlin1/library-tests/methods/exprs.expected @@ -132,9 +132,6 @@ | dataClass.kt:1:34:1:46 | this.y | VarAccess | | dataClass.kt:1:34:1:46 | y | VarAccess | | dataClass.kt:1:34:1:46 | y | VarAccess | -| delegates.kt:1:9:1:12 | this | ThisAccess | -| delegates.kt:1:9:1:12 | this | ThisAccess | -| delegates.kt:1:9:1:12 | this | ThisAccess | | delegates.kt:4:5:6:5 | int | TypeAccess | | delegates.kt:4:18:6:5 | ...=... | KtInitializerAssignExpr | | delegates.kt:4:18:6:5 | Integer | TypeAccess | @@ -156,6 +153,7 @@ | delegates.kt:4:21:6:5 | lazy(...) | MethodCall | | delegates.kt:4:21:6:5 | this | ThisAccess | | delegates.kt:4:21:6:5 | this | ThisAccess | +| delegates.kt:4:21:6:5 | this | ThisAccess | | delegates.kt:4:21:6:5 | this.lazyProp$delegate | VarAccess | | delegates.kt:4:26:6:5 | ...->... | LambdaExpr | | delegates.kt:4:26:6:5 | Function0 | TypeAccess | @@ -202,6 +200,8 @@ | delegates.kt:8:35:11:5 | this | ThisAccess | | delegates.kt:8:35:11:5 | this | ThisAccess | | delegates.kt:8:35:11:5 | this | ThisAccess | +| delegates.kt:8:35:11:5 | this | ThisAccess | +| delegates.kt:8:35:11:5 | this | ThisAccess | | delegates.kt:8:35:11:5 | this.observableProp$delegate | VarAccess | | delegates.kt:8:35:11:5 | this.observableProp$delegate | VarAccess | | delegates.kt:8:56:8:63 | "" | StringLiteral |