diff --git a/java/kotlin-extractor/src/main/kotlin/KotlinFileExtractor.kt b/java/kotlin-extractor/src/main/kotlin/KotlinFileExtractor.kt index ca67e28abcd..2117d83d758 100644 --- a/java/kotlin-extractor/src/main/kotlin/KotlinFileExtractor.kt +++ b/java/kotlin-extractor/src/main/kotlin/KotlinFileExtractor.kt @@ -1748,7 +1748,8 @@ open class KotlinFileExtractor( extractMethodAndParameterTypeAccesses: Boolean, extractAnnotations: Boolean, typeSubstitution: TypeSubstitution?, - classTypeArgsIncludingOuterClasses: List? + classTypeArgsIncludingOuterClasses: List?, + overriddenAttributes: OverriddenFunctionAttributes? = null ) = if (isFake(f)) { if (needsInterfaceForwarder(f)) @@ -1766,8 +1767,18 @@ open class KotlinFileExtractor( // specifically in interfaces loaded from Java classes show up like fake overrides. val overriddenVisibility = if (f.isFakeOverride && isJavaBinaryObjectMethodRedeclaration(f)) - OverriddenFunctionAttributes(visibility = DescriptorVisibilities.PUBLIC) + DescriptorVisibilities.PUBLIC else null + // Merge caller-supplied overrides with the internal visibility adjustment. + val mergedAttributes = when { + overriddenAttributes == null && overriddenVisibility == null -> null + overriddenAttributes == null -> OverriddenFunctionAttributes(visibility = overriddenVisibility) + overriddenVisibility == null -> overriddenAttributes + else -> overriddenAttributes.copy( + visibility = overriddenVisibility.takeUnless { overriddenAttributes.visibility != null } + ?: overriddenAttributes.visibility + ) + } forceExtractFunction( f, parentId, @@ -1776,7 +1787,7 @@ open class KotlinFileExtractor( extractAnnotations, typeSubstitution, classTypeArgsIncludingOuterClasses, - overriddenAttributes = overriddenVisibility + overriddenAttributes = mergedAttributes ) .also { // The defaults-forwarder function is a static utility, not a member, so we only @@ -2659,9 +2670,14 @@ open class KotlinFileExtractor( DeclarationStackAdjuster(p).use { val id = useProperty(p, parentId, classTypeArgsIncludingOuterClasses) + // PSI location is only used for the primary (unspecialised) extraction. Specialised + // generic instances defer to getLocation so that the backing binary-file location is + // preserved, keeping specialised properties absent from fromSource() queries. val locId = - if (usesK2) getPsiBasedLocation(p) ?: getLocation(p, classTypeArgsIncludingOuterClasses) - else getLocation(p, classTypeArgsIncludingOuterClasses) + if (classTypeArgsIncludingOuterClasses.isNullOrEmpty()) + getPsiBasedLocation(p) ?: getLocation(p, classTypeArgsIncludingOuterClasses) + else + getLocation(p, classTypeArgsIncludingOuterClasses) tw.writeKtProperties(id, p.name.asString()) tw.writeHasLocation(id, locId) @@ -2669,6 +2685,13 @@ open class KotlinFileExtractor( val getter = p.getter val setter = p.setter + // Synthesised (DEFAULT_PROPERTY_ACCESSOR) getter and setter represent the + // whole property declaration, so they share the property's location. + fun accessorOverride(f: IrFunction) = + if (f.origin == IrDeclarationOrigin.DEFAULT_PROPERTY_ACCESSOR) + OverriddenFunctionAttributes(sourceLoc = locId) + else null + if (getter == null) { if (!isExternalDeclaration(p)) { logger.warnElement("IrProperty without a getter", p) @@ -2682,7 +2705,8 @@ open class KotlinFileExtractor( extractMethodAndParameterTypeAccesses = extractFunctionBodies, extractAnnotations = extractAnnotations, typeSubstitution, - classTypeArgsIncludingOuterClasses + classTypeArgsIncludingOuterClasses, + overriddenAttributes = accessorOverride(getter) ) ?.cast() if (getterId != null) { @@ -2712,7 +2736,8 @@ open class KotlinFileExtractor( extractMethodAndParameterTypeAccesses = extractFunctionBodies, extractAnnotations = extractAnnotations, typeSubstitution, - classTypeArgsIncludingOuterClasses + classTypeArgsIncludingOuterClasses, + overriddenAttributes = accessorOverride(setter) ) ?.cast() if (setterId != null) { @@ -2931,6 +2956,34 @@ open class KotlinFileExtractor( return tw.getLocation(declStart, declaration.endOffset) } + /** + * Returns the PSI-based location for a property declaration, spanning from + * the `val`/`var` keyword to the end of the full property declaration (including + * any explicit getter/setter body). + * + * IR offsets are inconsistent across K1 and K2: + * - K1 [IrProperty.startOffset] includes leading modifiers (private, abstract, + * lateinit, @Annotation) in the span start. K2 starts at `val`/`var`. + * - K1 [IrProperty.endOffset] stops at the end of the declaration line and + * does not include an explicit getter/setter body on a subsequent line. K2 + * includes the getter/setter body. + * + * Both are resolved by walking the PSI tree: the [KtProperty] node covers the + * full declaration including getter/setter, and [KtProperty.valOrVarKeyword] + * gives the correct start, excluding modifiers. + */ + private fun getPsiBasedLocation(p: IrProperty): Label? { + if (p.startOffset < 0 || p.endOffset < 0) return null + val file = currentIrFile ?: return null + val ktFile = getPsi2Ir()?.getKtFile(file) ?: return null + val ktProperty = ktFile.findElementAt(p.startOffset) + ?.let { leaf -> generateSequence(leaf) { it.parent }.filterIsInstance().firstOrNull() } + ?: return null + val declStart = ktProperty.valOrVarKeyword.startOffset + val declEnd = ktProperty.endOffset + return tw.getLocation(declStart, declEnd) + } + private fun extractVariable( v: IrVariable, callable: Label, diff --git a/java/ql/test-kotlin1/library-tests/comments/comments.expected b/java/ql/test-kotlin1/library-tests/comments/comments.expected index 0b0d16dc346..bcda3ec0f74 100644 --- a/java/ql/test-kotlin1/library-tests/comments/comments.expected +++ b/java/ql/test-kotlin1/library-tests/comments/comments.expected @@ -19,8 +19,8 @@ comments commentOwners | comments.kt:4:1:11:3 | /**\n * A group of *members*.\n *\n * This class has no useful logic; it's just a documentation example.\n *\n * @property name the name of this group.\n * @constructor Creates an empty group.\n */ | comments.kt:12:1:31:1 | Group | | comments.kt:14:5:16:7 | /**\n * Members of this group.\n */ | comments.kt:17:5:17:46 | members | -| comments.kt:14:5:16:7 | /**\n * Members of this group.\n */ | comments.kt:17:5:17:46 | members | | comments.kt:14:5:16:7 | /**\n * Members of this group.\n */ | comments.kt:17:13:17:46 | getMembers$private | +| comments.kt:14:5:16:7 | /**\n * Members of this group.\n */ | comments.kt:17:13:17:46 | members | | comments.kt:19:5:22:7 | /**\n * Adds a [member] to this group.\n * @return the new size of the group.\n */ | comments.kt:23:5:26:5 | add | | comments.kt:35:5:35:34 | /** Medium is in the middle */ | comments.kt:36:5:36:14 | Medium | | comments.kt:37:5:37:23 | /** This is high */ | comments.kt:38:5:38:11 | High | diff --git a/java/ql/test-kotlin1/library-tests/compilation-units/cus.expected b/java/ql/test-kotlin1/library-tests/compilation-units/cus.expected index 97b688e8795..6a09d9908c3 100644 --- a/java/ql/test-kotlin1/library-tests/compilation-units/cus.expected +++ b/java/ql/test-kotlin1/library-tests/compilation-units/cus.expected @@ -2,6 +2,8 @@ | AbstractList$RandomAccessSpliterator | .../AbstractList$RandomAccessSpliterator.class:0:0:0:0 | | ArrayList | .../ArrayList.class:0:0:0:0 | | ArrayList$ArrayListSpliterator | .../ArrayList$ArrayListSpliterator.class:0:0:0:0 | +| CleanerImpl$CleanableList | .../CleanerImpl$CleanableList.class:0:0:0:0 | +| CleanerImpl$CleanableList$Node | .../CleanerImpl$CleanableList$Node.class:0:0:0:0 | | List | .../List.class:0:0:0:0 | | ListIterator | .../ListIterator.class:0:0:0:0 | | MemorySessionImpl$ResourceList | .../MemorySessionImpl$ResourceList.class:0:0:0:0 | diff --git a/java/ql/test-kotlin1/library-tests/modifiers/modifiers.expected b/java/ql/test-kotlin1/library-tests/modifiers/modifiers.expected index bc7c6207642..7badb98a44b 100644 --- a/java/ql/test-kotlin1/library-tests/modifiers/modifiers.expected +++ b/java/ql/test-kotlin1/library-tests/modifiers/modifiers.expected @@ -2,17 +2,17 @@ | modifiers.kt:1:6:29:1 | X | Constructor | public | | modifiers.kt:2:5:2:21 | a | Field | final | | modifiers.kt:2:5:2:21 | a | Field | private | -| modifiers.kt:2:5:2:21 | a | Property | private | +| modifiers.kt:2:13:2:21 | a | Property | private | | modifiers.kt:2:13:2:21 | getA$private | Method | final | | modifiers.kt:2:13:2:21 | getA$private | Method | private | | modifiers.kt:3:5:3:23 | b | Field | final | | modifiers.kt:3:5:3:23 | b | Field | private | -| modifiers.kt:3:5:3:23 | b | Property | protected | +| modifiers.kt:3:15:3:23 | b | Property | protected | | modifiers.kt:3:15:3:23 | getB | Method | final | | modifiers.kt:3:15:3:23 | getB | Method | protected | | modifiers.kt:4:5:4:22 | c | Field | final | | modifiers.kt:4:5:4:22 | c | Field | private | -| modifiers.kt:4:5:4:22 | c | Property | internal | +| modifiers.kt:4:14:4:22 | c | Property | internal | | modifiers.kt:4:14:4:22 | getC$main | Method | final | | modifiers.kt:4:14:4:22 | getC$main | Method | internal | | modifiers.kt:5:5:5:34 | d | Field | final | @@ -25,7 +25,7 @@ | modifiers.kt:7:15:9:5 | Nested | Constructor | public | | modifiers.kt:8:9:8:29 | e | Field | final | | modifiers.kt:8:9:8:29 | e | Field | private | -| modifiers.kt:8:9:8:29 | e | Property | public | +| modifiers.kt:8:16:8:29 | e | Property | public | | modifiers.kt:8:16:8:29 | getE | Method | final | | modifiers.kt:8:16:8:29 | getE | Method | public | | modifiers.kt:11:5:15:5 | fn1 | Method | final | @@ -76,12 +76,12 @@ | modifiers.kt:35:1:41:1 | LateInit | Class | public | | modifiers.kt:35:8:41:1 | LateInit | Constructor | public | | modifiers.kt:36:5:36:40 | test0 | Field | private | -| modifiers.kt:36:5:36:40 | test0 | Property | lateinit | -| modifiers.kt:36:5:36:40 | test0 | Property | private | | modifiers.kt:36:22:36:40 | getTest0$private | Method | final | | modifiers.kt:36:22:36:40 | getTest0$private | Method | private | | modifiers.kt:36:22:36:40 | setTest0$private | Method | final | | modifiers.kt:36:22:36:40 | setTest0$private | Method | private | +| modifiers.kt:36:22:36:40 | test0 | Property | lateinit | +| modifiers.kt:36:22:36:40 | test0 | Property | private | | modifiers.kt:38:5:40:5 | fn | Method | final | | modifiers.kt:38:5:40:5 | fn | Method | public | | modifiers.kt:39:18:39:36 | LateInit test1 | LocalVariableDecl | lateinit | diff --git a/java/ql/test-kotlin1/library-tests/properties/properties.expected b/java/ql/test-kotlin1/library-tests/properties/properties.expected index 1f60e9054b2..8cc2702ab5a 100644 --- a/java/ql/test-kotlin1/library-tests/properties/properties.expected +++ b/java/ql/test-kotlin1/library-tests/properties/properties.expected @@ -4,30 +4,30 @@ | properties.kt:3:5:3:25 | modifiableInt | properties.kt:3:5:3:25 | getModifiableInt | properties.kt:3:5:3:25 | setModifiableInt | properties.kt:3:5:3:25 | modifiableInt | public | | properties.kt:4:5:4:24 | immutableInt | properties.kt:4:5:4:24 | getImmutableInt | file://:0:0:0:0 | | properties.kt:4:5:4:24 | immutableInt | public | | properties.kt:5:5:5:26 | typedProp | properties.kt:5:5:5:26 | getTypedProp | file://:0:0:0:0 | | properties.kt:5:5:5:26 | typedProp | public | -| properties.kt:6:5:6:38 | abstractTypeProp | properties.kt:6:14:6:38 | getAbstractTypeProp | file://:0:0:0:0 | | file://:0:0:0:0 | | public | +| properties.kt:6:14:6:38 | abstractTypeProp | properties.kt:6:14:6:38 | getAbstractTypeProp | file://:0:0:0:0 | | file://:0:0:0:0 | | public | | properties.kt:7:5:7:30 | initialisedInInit | properties.kt:7:5:7:30 | getInitialisedInInit | file://:0:0:0:0 | | properties.kt:7:5:7:30 | initialisedInInit | public | | properties.kt:11:5:11:40 | useConstructorArg | properties.kt:11:5:11:40 | getUseConstructorArg | file://:0:0:0:0 | | properties.kt:11:5:11:40 | useConstructorArg | public | | properties.kt:12:5:13:21 | five | properties.kt:13:13:13:21 | getFive | file://:0:0:0:0 | | file://:0:0:0:0 | | public | | properties.kt:14:5:15:21 | six | properties.kt:15:13:15:21 | getSix | file://:0:0:0:0 | | file://:0:0:0:0 | | public | | properties.kt:16:5:18:40 | getSet | properties.kt:17:13:17:33 | getGetSet | properties.kt:18:13:18:40 | setGetSet | file://:0:0:0:0 | | public | -| properties.kt:19:5:20:15 | defaultGetter | properties.kt:20:13:20:15 | getDefaultGetter | file://:0:0:0:0 | | properties.kt:19:5:20:15 | defaultGetter | public | -| properties.kt:21:5:22:15 | varDefaultGetter | properties.kt:22:13:22:15 | getVarDefaultGetter | properties.kt:21:5:22:15 | setVarDefaultGetter | properties.kt:21:5:22:15 | varDefaultGetter | public | -| properties.kt:23:5:24:15 | varDefaultSetter | properties.kt:23:5:24:15 | getVarDefaultSetter | properties.kt:24:13:24:15 | setVarDefaultSetter | properties.kt:23:5:24:15 | varDefaultSetter | public | -| properties.kt:25:5:27:15 | varDefaultGetterSetter | properties.kt:26:13:26:15 | getVarDefaultGetterSetter | properties.kt:27:13:27:15 | setVarDefaultGetterSetter | properties.kt:25:5:27:15 | varDefaultGetterSetter | public | +| properties.kt:19:5:20:15 | defaultGetter | properties.kt:19:5:20:15 | getDefaultGetter | file://:0:0:0:0 | | properties.kt:19:5:20:15 | defaultGetter | public | +| properties.kt:21:5:22:15 | varDefaultGetter | properties.kt:21:5:22:15 | getVarDefaultGetter | properties.kt:21:5:22:15 | setVarDefaultGetter | properties.kt:21:5:22:15 | varDefaultGetter | public | +| properties.kt:23:5:24:15 | varDefaultSetter | properties.kt:23:5:24:15 | getVarDefaultSetter | properties.kt:23:5:24:15 | setVarDefaultSetter | properties.kt:23:5:24:15 | varDefaultSetter | public | +| properties.kt:25:5:27:15 | varDefaultGetterSetter | properties.kt:25:5:27:15 | getVarDefaultGetterSetter | properties.kt:25:5:27:15 | setVarDefaultGetterSetter | properties.kt:25:5:27:15 | varDefaultGetterSetter | public | | properties.kt:28:5:29:22 | overrideGetter | properties.kt:29:13:29:22 | getOverrideGetter | properties.kt:28:5:29:22 | setOverrideGetter | properties.kt:28:5:29:22 | overrideGetter | public | | properties.kt:30:5:31:29 | overrideGetterUseField | properties.kt:31:13:31:29 | getOverrideGetterUseField | properties.kt:30:5:31:29 | setOverrideGetterUseField | properties.kt:30:5:31:29 | overrideGetterUseField | public | | properties.kt:32:5:33:29 | useField | properties.kt:33:13:33:29 | getUseField | file://:0:0:0:0 | | properties.kt:32:5:33:29 | useField | public | -| properties.kt:34:5:34:36 | lateInitVar | properties.kt:34:14:34:36 | getLateInitVar | properties.kt:34:14:34:36 | setLateInitVar | properties.kt:34:5:34:36 | lateInitVar | lateinit, public | -| properties.kt:35:5:35:32 | privateProp | properties.kt:35:13:35:32 | getPrivateProp$private | file://:0:0:0:0 | | properties.kt:35:5:35:32 | privateProp | private | -| properties.kt:36:5:36:36 | protectedProp | properties.kt:36:15:36:36 | getProtectedProp | file://:0:0:0:0 | | properties.kt:36:5:36:36 | protectedProp | protected | -| properties.kt:37:5:37:30 | publicProp | properties.kt:37:12:37:30 | getPublicProp | file://:0:0:0:0 | | properties.kt:37:5:37:30 | publicProp | public | -| properties.kt:38:5:38:34 | internalProp | properties.kt:38:14:38:34 | getInternalProp$main | file://:0:0:0:0 | | properties.kt:38:5:38:34 | internalProp | internal | -| properties.kt:67:1:67:23 | constVal | properties.kt:67:7:67:23 | getConstVal | file://:0:0:0:0 | | properties.kt:67:1:67:23 | constVal | public | +| properties.kt:34:14:34:36 | lateInitVar | properties.kt:34:14:34:36 | getLateInitVar | properties.kt:34:14:34:36 | setLateInitVar | properties.kt:34:5:34:36 | lateInitVar | lateinit, public | +| properties.kt:35:13:35:32 | privateProp | properties.kt:35:13:35:32 | getPrivateProp$private | file://:0:0:0:0 | | properties.kt:35:5:35:32 | privateProp | private | +| properties.kt:36:15:36:36 | protectedProp | properties.kt:36:15:36:36 | getProtectedProp | file://:0:0:0:0 | | properties.kt:36:5:36:36 | protectedProp | protected | +| properties.kt:37:12:37:30 | publicProp | properties.kt:37:12:37:30 | getPublicProp | file://:0:0:0:0 | | properties.kt:37:5:37:30 | publicProp | public | +| properties.kt:38:14:38:34 | internalProp | properties.kt:38:14:38:34 | getInternalProp$main | file://:0:0:0:0 | | properties.kt:38:5:38:34 | internalProp | internal | +| properties.kt:67:7:67:23 | constVal | properties.kt:67:7:67:23 | getConstVal | file://:0:0:0:0 | | properties.kt:67:1:67:23 | constVal | public | | properties.kt:70:5:70:16 | prop | properties.kt:70:5:70:16 | getProp | file://:0:0:0:0 | | properties.kt:70:5:70:16 | prop | public | | properties.kt:78:1:79:13 | x | properties.kt:79:5:79:13 | getX | file://:0:0:0:0 | | file://:0:0:0:0 | | public | | properties.kt:80:1:81:13 | x | properties.kt:81:5:81:13 | getX | file://:0:0:0:0 | | file://:0:0:0:0 | | public | -| properties.kt:84:5:84:29 | data | properties.kt:84:13:84:29 | getData$private | properties.kt:84:13:84:29 | setData$private | properties.kt:84:5:84:29 | data | private | -| properties.kt:92:5:93:18 | data | properties.kt:93:9:93:18 | getData | properties.kt:92:13:93:18 | setData$private | properties.kt:92:5:93:18 | data | private | +| properties.kt:84:13:84:29 | data | properties.kt:84:13:84:29 | getData$private | properties.kt:84:13:84:29 | setData$private | properties.kt:84:5:84:29 | data | private | +| properties.kt:92:13:93:18 | data | properties.kt:93:9:93:18 | getData | properties.kt:92:13:93:18 | setData$private | properties.kt:92:5:93:18 | data | private | fieldDeclarations | properties.kt:2:27:2:50 | int constructorProp; | properties.kt:2:27:2:50 | constructorProp | 0 | | properties.kt:2:53:2:83 | int mutableConstructorProp; | properties.kt:2:53:2:83 | mutableConstructorProp | 0 | diff --git a/java/ql/test-kotlin2/library-tests/annotation_classes/classes.expected b/java/ql/test-kotlin2/library-tests/annotation_classes/classes.expected index db4ef27b32b..47b8869327b 100644 --- a/java/ql/test-kotlin2/library-tests/annotation_classes/classes.expected +++ b/java/ql/test-kotlin2/library-tests/annotation_classes/classes.expected @@ -32,8 +32,8 @@ annotations | def.kt:41:5:41:12 | Annot0k | def.kt:42:5:42:19 | Z | def.kt:5:1:21:60 | Annot0k | | def.kt:45:1:45:8 | Annot0k | def.kt:46:1:51:1 | fn | def.kt:5:1:21:60 | Annot0k | | def.kt:46:21:46:28 | Annot0k | def.kt:46:21:46:39 | a | def.kt:5:1:21:60 | Annot0k | -| def.kt:54:1:54:12 | Annot0k | def.kt:57:1:57:19 | getP | def.kt:5:1:21:60 | Annot0k | -| def.kt:55:1:55:12 | Annot0k | def.kt:57:1:57:19 | setP | def.kt:5:1:21:60 | Annot0k | +| def.kt:54:1:54:12 | Annot0k | def.kt:57:1:57:23 | getP | def.kt:5:1:21:60 | Annot0k | +| def.kt:55:1:55:12 | Annot0k | def.kt:57:1:57:23 | setP | def.kt:5:1:21:60 | Annot0k | | def.kt:56:1:56:14 | Annot0k | def.kt:57:1:57:23 | p | def.kt:5:1:21:60 | Annot0k | | def.kt:59:5:59:21 | Annot0k | def.kt:59:5:59:28 | | def.kt:5:1:21:60 | Annot0k | | use.java:10:5:10:21 | Annot0j | use.java:14:18:14:18 | Z | Annot0j.java:1:19:1:25 | Annot0j | diff --git a/java/ql/test-kotlin2/library-tests/annotations/jvmName/test.expected b/java/ql/test-kotlin2/library-tests/annotations/jvmName/test.expected index ba6887606f2..42dfcd7d2e7 100644 --- a/java/ql/test-kotlin2/library-tests/annotations/jvmName/test.expected +++ b/java/ql/test-kotlin2/library-tests/annotations/jvmName/test.expected @@ -1,8 +1,8 @@ | Test.java:2:17:2:17 | m | m | m | | test.kt:3:9:4:18 | getX_prop | getX_prop | getX | | test.kt:6:5:6:19 | getX | getX | getX | -| test.kt:10:5:10:14 | changeY | changeY | setY | -| test.kt:10:5:10:14 | y | y | getY | +| test.kt:10:5:10:19 | changeY | changeY | setY | +| test.kt:10:5:10:19 | y | y | getY | | test.kt:13:5:13:15 | method | method | fn | | test.kt:17:5:17:14 | p | p | p | | test.kt:18:23:18:32 | w | w | q | diff --git a/java/ql/test-kotlin2/library-tests/classes/genericExprTypes.expected b/java/ql/test-kotlin2/library-tests/classes/genericExprTypes.expected index 46522bd2145..b144b6cab08 100644 --- a/java/ql/test-kotlin2/library-tests/classes/genericExprTypes.expected +++ b/java/ql/test-kotlin2/library-tests/classes/genericExprTypes.expected @@ -6,22 +6,22 @@ | generic_anonymous.kt:1:26:1:33 | t | T | | generic_anonymous.kt:1:26:1:33 | this | Generic | | generic_anonymous.kt:1:26:1:33 | this.t | T | -| generic_anonymous.kt:3:11:3:15 | T | T | -| generic_anonymous.kt:3:11:3:15 | new Object(...) { ... } | new Object(...) { ... } | | generic_anonymous.kt:3:11:3:15 | this | Generic | | generic_anonymous.kt:3:11:3:15 | this.x | new Object(...) { ... } | | generic_anonymous.kt:3:11:5:3 | ...=... | new Object(...) { ... } | | generic_anonymous.kt:3:11:5:3 | T | T | +| generic_anonymous.kt:3:11:5:3 | T | T | +| generic_anonymous.kt:3:11:5:3 | new Object(...) { ... } | new Object(...) { ... } | | generic_anonymous.kt:3:11:5:3 | new Object(...) { ... } | new Object(...) { ... } | | generic_anonymous.kt:3:11:5:3 | x | new Object(...) { ... } | | generic_anonymous.kt:3:19:5:3 | | new Object(...) { ... } | | generic_anonymous.kt:3:19:5:3 | Object | Object | | generic_anonymous.kt:3:19:5:3 | new (...) | new Object(...) { ... } | -| generic_anonymous.kt:4:7:4:16 | T | T | | generic_anonymous.kt:4:7:4:16 | this | new Object(...) { ... } | | generic_anonymous.kt:4:7:4:16 | this.member | T | | generic_anonymous.kt:4:7:4:20 | ...=... | T | | generic_anonymous.kt:4:7:4:20 | T | T | +| generic_anonymous.kt:4:7:4:20 | T | T | | generic_anonymous.kt:4:7:4:20 | member | T | | generic_anonymous.kt:4:20:4:20 | Generic | Generic | | generic_anonymous.kt:4:20:4:20 | Generic.this | Generic | diff --git a/java/ql/test-kotlin2/library-tests/comments/comments.expected b/java/ql/test-kotlin2/library-tests/comments/comments.expected index 8c163a2a523..555a44b388b 100644 --- a/java/ql/test-kotlin2/library-tests/comments/comments.expected +++ b/java/ql/test-kotlin2/library-tests/comments/comments.expected @@ -18,7 +18,7 @@ comments commentOwners | comments.kt:1:1:1:36 | /** Kdoc owned by CompilationUnit */ | comments.kt:0:0:0:0 | comments | | comments.kt:4:1:11:3 | /**\n * A group of *members*.\n *\n * This class has no useful logic; it's just a documentation example.\n *\n * @property name the name of this group.\n * @constructor Creates an empty group.\n */ | comments.kt:12:1:31:1 | Group | -| comments.kt:14:5:16:7 | /**\n * Members of this group.\n */ | comments.kt:17:13:17:23 | getMembers$private | +| comments.kt:14:5:16:7 | /**\n * Members of this group.\n */ | comments.kt:17:13:17:46 | getMembers$private | | comments.kt:14:5:16:7 | /**\n * Members of this group.\n */ | comments.kt:17:13:17:46 | members | | comments.kt:14:5:16:7 | /**\n * Members of this group.\n */ | comments.kt:17:13:17:46 | members | | comments.kt:19:5:22:7 | /**\n * Adds a [member] to this group.\n * @return the new size of the group.\n */ | comments.kt:23:5:26:5 | add | diff --git a/java/ql/test-kotlin2/library-tests/compilation-units/cus.expected b/java/ql/test-kotlin2/library-tests/compilation-units/cus.expected index 97b688e8795..6a09d9908c3 100644 --- a/java/ql/test-kotlin2/library-tests/compilation-units/cus.expected +++ b/java/ql/test-kotlin2/library-tests/compilation-units/cus.expected @@ -2,6 +2,8 @@ | AbstractList$RandomAccessSpliterator | .../AbstractList$RandomAccessSpliterator.class:0:0:0:0 | | ArrayList | .../ArrayList.class:0:0:0:0 | | ArrayList$ArrayListSpliterator | .../ArrayList$ArrayListSpliterator.class:0:0:0:0 | +| CleanerImpl$CleanableList | .../CleanerImpl$CleanableList.class:0:0:0:0 | +| CleanerImpl$CleanableList$Node | .../CleanerImpl$CleanableList$Node.class:0:0:0:0 | | List | .../List.class:0:0:0:0 | | ListIterator | .../ListIterator.class:0:0:0:0 | | MemorySessionImpl$ResourceList | .../MemorySessionImpl$ResourceList.class:0:0:0:0 | diff --git a/java/ql/test-kotlin2/library-tests/exprs/exprs.expected b/java/ql/test-kotlin2/library-tests/exprs/exprs.expected index 8c86fe5a1b2..acbf619e0bb 100644 --- a/java/ql/test-kotlin2/library-tests/exprs/exprs.expected +++ b/java/ql/test-kotlin2/library-tests/exprs/exprs.expected @@ -116,18 +116,18 @@ | delegatedProperties.kt:25:64:31:9 | | delegatedProperties.kt:25:9:31:9 | resourceDelegate | StmtExpr | | delegatedProperties.kt:25:64:31:9 | ReadWriteProperty | delegatedProperties.kt:25:9:31:9 | resourceDelegate | TypeAccess | | delegatedProperties.kt:25:64:31:9 | new (...) | delegatedProperties.kt:25:9:31:9 | resourceDelegate | ClassInstanceExpr | -| delegatedProperties.kt:26:13:26:24 | ...=... | delegatedProperties.kt:26:13:26:24 | setCurValue | AssignExpr | -| delegatedProperties.kt:26:13:26:24 | | delegatedProperties.kt:26:13:26:24 | setCurValue | VarAccess | -| delegatedProperties.kt:26:13:26:24 | Unit | file://:0:0:0:0 | | TypeAccess | -| delegatedProperties.kt:26:13:26:24 | int | file://:0:0:0:0 | | TypeAccess | -| delegatedProperties.kt:26:13:26:24 | int | file://:0:0:0:0 | | TypeAccess | -| delegatedProperties.kt:26:13:26:24 | this | delegatedProperties.kt:26:13:26:24 | getCurValue | ThisAccess | -| delegatedProperties.kt:26:13:26:24 | this | delegatedProperties.kt:26:13:26:24 | setCurValue | ThisAccess | -| delegatedProperties.kt:26:13:26:24 | this.curValue | delegatedProperties.kt:26:13:26:24 | getCurValue | VarAccess | -| delegatedProperties.kt:26:13:26:24 | this.curValue | delegatedProperties.kt:26:13:26:24 | setCurValue | VarAccess | +| delegatedProperties.kt:26:13:26:24 | ...=... | delegatedProperties.kt:26:13:26:28 | setCurValue | AssignExpr | +| delegatedProperties.kt:26:13:26:24 | | delegatedProperties.kt:26:13:26:28 | setCurValue | VarAccess | +| delegatedProperties.kt:26:13:26:24 | this | delegatedProperties.kt:26:13:26:28 | getCurValue | ThisAccess | +| delegatedProperties.kt:26:13:26:24 | this | delegatedProperties.kt:26:13:26:28 | setCurValue | ThisAccess | +| delegatedProperties.kt:26:13:26:24 | this.curValue | delegatedProperties.kt:26:13:26:28 | getCurValue | VarAccess | +| delegatedProperties.kt:26:13:26:24 | this.curValue | delegatedProperties.kt:26:13:26:28 | setCurValue | VarAccess | | delegatedProperties.kt:26:13:26:28 | ...=... | delegatedProperties.kt:25:64:31:9 | | KtInitializerAssignExpr | +| delegatedProperties.kt:26:13:26:28 | Unit | file://:0:0:0:0 | | TypeAccess | | delegatedProperties.kt:26:13:26:28 | curValue | delegatedProperties.kt:25:64:31:9 | | VarAccess | | delegatedProperties.kt:26:13:26:28 | int | file://:0:0:0:0 | | TypeAccess | +| delegatedProperties.kt:26:13:26:28 | int | file://:0:0:0:0 | | TypeAccess | +| delegatedProperties.kt:26:13:26:28 | int | file://:0:0:0:0 | | TypeAccess | | delegatedProperties.kt:26:28:26:28 | 0 | delegatedProperties.kt:25:64:31:9 | | IntegerLiteral | | delegatedProperties.kt:27:22:27:88 | int | file://:0:0:0:0 | | TypeAccess | | delegatedProperties.kt:27:35:27:47 | Object | file://:0:0:0:0 | | TypeAccess | @@ -281,18 +281,18 @@ | delegatedProperties.kt:54:51:54:68 | KProperty | file://:0:0:0:0 | | TypeAccess | | delegatedProperties.kt:56:16:56:33 | ResourceDelegate | delegatedProperties.kt:54:14:57:5 | provideDelegate | TypeAccess | | delegatedProperties.kt:56:16:56:33 | new ResourceDelegate(...) | delegatedProperties.kt:54:14:57:5 | provideDelegate | ClassInstanceExpr | -| delegatedProperties.kt:60:1:60:20 | ...=... | delegatedProperties.kt:60:1:60:20 | setTopLevelInt | AssignExpr | -| delegatedProperties.kt:60:1:60:20 | | delegatedProperties.kt:60:1:60:20 | setTopLevelInt | VarAccess | -| delegatedProperties.kt:60:1:60:20 | DelegatedPropertiesKt | delegatedProperties.kt:60:1:60:20 | getTopLevelInt | TypeAccess | -| delegatedProperties.kt:60:1:60:20 | DelegatedPropertiesKt | delegatedProperties.kt:60:1:60:20 | setTopLevelInt | TypeAccess | -| delegatedProperties.kt:60:1:60:20 | DelegatedPropertiesKt.topLevelInt | delegatedProperties.kt:60:1:60:20 | getTopLevelInt | VarAccess | -| delegatedProperties.kt:60:1:60:20 | DelegatedPropertiesKt.topLevelInt | delegatedProperties.kt:60:1:60:20 | setTopLevelInt | VarAccess | -| delegatedProperties.kt:60:1:60:20 | Unit | file://:0:0:0:0 | | TypeAccess | -| delegatedProperties.kt:60:1:60:20 | int | file://:0:0:0:0 | | TypeAccess | -| delegatedProperties.kt:60:1:60:20 | int | file://:0:0:0:0 | | TypeAccess | +| delegatedProperties.kt:60:1:60:20 | ...=... | delegatedProperties.kt:60:1:60:24 | setTopLevelInt | AssignExpr | +| delegatedProperties.kt:60:1:60:20 | | delegatedProperties.kt:60:1:60:24 | setTopLevelInt | VarAccess | +| delegatedProperties.kt:60:1:60:20 | DelegatedPropertiesKt | delegatedProperties.kt:60:1:60:24 | getTopLevelInt | TypeAccess | +| delegatedProperties.kt:60:1:60:20 | DelegatedPropertiesKt | delegatedProperties.kt:60:1:60:24 | setTopLevelInt | TypeAccess | +| delegatedProperties.kt:60:1:60:20 | DelegatedPropertiesKt.topLevelInt | delegatedProperties.kt:60:1:60:24 | getTopLevelInt | VarAccess | +| delegatedProperties.kt:60:1:60:20 | DelegatedPropertiesKt.topLevelInt | delegatedProperties.kt:60:1:60:24 | setTopLevelInt | VarAccess | | delegatedProperties.kt:60:1:60:24 | ...=... | delegatedProperties.kt:0:0:0:0 | | KtInitializerAssignExpr | | delegatedProperties.kt:60:1:60:24 | DelegatedPropertiesKt | delegatedProperties.kt:0:0:0:0 | | TypeAccess | | delegatedProperties.kt:60:1:60:24 | DelegatedPropertiesKt.topLevelInt | delegatedProperties.kt:0:0:0:0 | | VarAccess | +| delegatedProperties.kt:60:1:60:24 | Unit | file://:0:0:0:0 | | TypeAccess | +| delegatedProperties.kt:60:1:60:24 | int | file://:0:0:0:0 | | TypeAccess | +| delegatedProperties.kt:60:1:60:24 | int | file://:0:0:0:0 | | TypeAccess | | delegatedProperties.kt:60:1:60:24 | int | file://:0:0:0:0 | | TypeAccess | | delegatedProperties.kt:60:24:60:24 | 0 | delegatedProperties.kt:0:0:0:0 | | IntegerLiteral | | delegatedProperties.kt:62:25:62:48 | ...=... | delegatedProperties.kt:62:24:62:49 | ClassWithDelegate | KtInitializerAssignExpr | @@ -1543,12 +1543,12 @@ | exprs.kt:186:5:186:27 | green | exprs.kt:184:1:187:1 | enums | LocalVariableDeclExpr | | exprs.kt:186:23:186:27 | Color | exprs.kt:184:1:187:1 | enums | TypeAccess | | exprs.kt:186:23:186:27 | Color.GREEN | exprs.kt:184:1:187:1 | enums | VarAccess | -| exprs.kt:192:5:192:10 | int | file://:0:0:0:0 | | TypeAccess | -| exprs.kt:192:5:192:10 | this | exprs.kt:192:5:192:10 | getA1 | ThisAccess | -| exprs.kt:192:5:192:10 | this.a1 | exprs.kt:192:5:192:10 | getA1 | VarAccess | +| exprs.kt:192:5:192:10 | this | exprs.kt:192:5:192:14 | getA1 | ThisAccess | +| exprs.kt:192:5:192:10 | this.a1 | exprs.kt:192:5:192:14 | getA1 | VarAccess | | exprs.kt:192:5:192:14 | ...=... | exprs.kt:191:1:199:1 | Class1 | KtInitializerAssignExpr | | exprs.kt:192:5:192:14 | a1 | exprs.kt:191:1:199:1 | Class1 | VarAccess | | exprs.kt:192:5:192:14 | int | file://:0:0:0:0 | | TypeAccess | +| exprs.kt:192:5:192:14 | int | file://:0:0:0:0 | | TypeAccess | | exprs.kt:192:14:192:14 | 1 | exprs.kt:191:1:199:1 | Class1 | IntegerLiteral | | exprs.kt:193:13:198:5 | Object | file://:0:0:0:0 | | TypeAccess | | exprs.kt:194:9:194:18 | a2 | exprs.kt:193:13:198:5 | getObject | LocalVariableDeclExpr | @@ -1556,11 +1556,11 @@ | exprs.kt:195:16:197:9 | | exprs.kt:193:13:198:5 | getObject | StmtExpr | | exprs.kt:195:16:197:9 | Interface1 | exprs.kt:193:13:198:5 | getObject | TypeAccess | | exprs.kt:195:16:197:9 | new (...) | exprs.kt:193:13:198:5 | getObject | ClassInstanceExpr | -| exprs.kt:196:13:196:26 | String | file://:0:0:0:0 | | TypeAccess | -| exprs.kt:196:13:196:26 | this | exprs.kt:196:13:196:26 | getA3 | ThisAccess | -| exprs.kt:196:13:196:26 | this.a3 | exprs.kt:196:13:196:26 | getA3 | VarAccess | +| exprs.kt:196:13:196:26 | this | exprs.kt:196:13:196:49 | getA3 | ThisAccess | +| exprs.kt:196:13:196:26 | this.a3 | exprs.kt:196:13:196:49 | getA3 | VarAccess | | exprs.kt:196:13:196:49 | ...=... | exprs.kt:195:16:197:9 | | KtInitializerAssignExpr | | exprs.kt:196:13:196:49 | String | file://:0:0:0:0 | | TypeAccess | +| exprs.kt:196:13:196:49 | String | file://:0:0:0:0 | | TypeAccess | | exprs.kt:196:13:196:49 | a3 | exprs.kt:195:16:197:9 | | VarAccess | | exprs.kt:196:31:196:32 | getA1(...) | exprs.kt:195:16:197:9 | | MethodCall | | exprs.kt:196:31:196:32 | this | exprs.kt:195:16:197:9 | | ThisAccess | @@ -4295,11 +4295,11 @@ | samConversion.kt:59:5:59:15 | fn1(...) | samConversion.kt:57:9:60:1 | test | MethodCall | | samConversion.kt:59:12:59:12 | 1 | samConversion.kt:57:9:60:1 | test | IntegerLiteral | | samConversion.kt:59:14:59:14 | 2 | samConversion.kt:57:9:60:1 | test | IntegerLiteral | -| samConversion.kt:63:5:63:9 | int | file://:0:0:0:0 | | TypeAccess | -| samConversion.kt:63:5:63:9 | this | samConversion.kt:63:5:63:9 | getX | ThisAccess | -| samConversion.kt:63:5:63:9 | this.x | samConversion.kt:63:5:63:9 | getX | VarAccess | +| samConversion.kt:63:5:63:9 | this | samConversion.kt:63:5:63:13 | getX | ThisAccess | +| samConversion.kt:63:5:63:9 | this.x | samConversion.kt:63:5:63:13 | getX | VarAccess | | samConversion.kt:63:5:63:13 | ...=... | samConversion.kt:62:1:64:1 | PropertyRefsTest | KtInitializerAssignExpr | | samConversion.kt:63:5:63:13 | int | file://:0:0:0:0 | | TypeAccess | +| samConversion.kt:63:5:63:13 | int | file://:0:0:0:0 | | TypeAccess | | samConversion.kt:63:5:63:13 | x | samConversion.kt:62:1:64:1 | PropertyRefsTest | VarAccess | | samConversion.kt:63:13:63:13 | 1 | samConversion.kt:62:1:64:1 | PropertyRefsTest | IntegerLiteral | | samConversion.kt:67:5:67:37 | int | file://:0:0:0:0 | | TypeAccess | diff --git a/java/ql/test-kotlin2/library-tests/exprs/funcExprs.expected b/java/ql/test-kotlin2/library-tests/exprs/funcExprs.expected index d4da8d6e0be..80f13cb8618 100644 --- a/java/ql/test-kotlin2/library-tests/exprs/funcExprs.expected +++ b/java/ql/test-kotlin2/library-tests/exprs/funcExprs.expected @@ -86,8 +86,8 @@ anon_class_member_modifiers | delegatedProperties.kt:19:34:19:51 | new KMutableProperty0(...) { ... } | delegatedProperties.kt:19:34:19:51 | set | override, public | | delegatedProperties.kt:23:29:23:31 | new KProperty0(...) { ... } | delegatedProperties.kt:23:29:23:31 | get | override, public | | delegatedProperties.kt:23:29:23:31 | new KProperty0(...) { ... } | delegatedProperties.kt:23:29:23:31 | invoke | override, public | -| delegatedProperties.kt:25:64:31:9 | new ReadWriteProperty(...) { ... } | delegatedProperties.kt:26:13:26:24 | getCurValue | final, public | -| delegatedProperties.kt:25:64:31:9 | new ReadWriteProperty(...) { ... } | delegatedProperties.kt:26:13:26:24 | setCurValue | final, public | +| delegatedProperties.kt:25:64:31:9 | new ReadWriteProperty(...) { ... } | delegatedProperties.kt:26:13:26:28 | getCurValue | final, public | +| delegatedProperties.kt:25:64:31:9 | new ReadWriteProperty(...) { ... } | delegatedProperties.kt:26:13:26:28 | setCurValue | final, public | | delegatedProperties.kt:25:64:31:9 | new ReadWriteProperty(...) { ... } | delegatedProperties.kt:27:22:27:88 | getValue | override, public | | delegatedProperties.kt:25:64:31:9 | new ReadWriteProperty(...) { ... } | delegatedProperties.kt:28:22:30:13 | setValue | override, public | | delegatedProperties.kt:33:30:33:47 | new KProperty0(...) { ... } | delegatedProperties.kt:33:30:33:47 | get | override, public | @@ -187,7 +187,7 @@ anon_class_member_modifiers | delegatedProperties.kt:87:34:87:46 | new KMutableProperty1(...) { ... } | delegatedProperties.kt:87:34:87:46 | invoke | override, public | | delegatedProperties.kt:87:34:87:46 | new KMutableProperty1(...) { ... } | delegatedProperties.kt:87:34:87:46 | set | override, public | | delegatedProperties.kt:87:34:87:46 | new KMutableProperty1(...) { ... } | delegatedProperties.kt:87:34:87:46 | set | override, public | -| exprs.kt:195:16:197:9 | new Interface1(...) { ... } | exprs.kt:196:13:196:26 | getA3 | final, public | +| exprs.kt:195:16:197:9 | new Interface1(...) { ... } | exprs.kt:196:13:196:49 | getA3 | final, public | | funcExprs.kt:22:26:22:33 | new Function0(...) { ... } | funcExprs.kt:22:26:22:33 | invoke | final, override, public | | funcExprs.kt:23:26:23:33 | new Function0(...) { ... } | funcExprs.kt:23:26:23:33 | invoke | final, override, public | | funcExprs.kt:24:26:24:33 | new Function0(...) { ... } | funcExprs.kt:24:26:24:33 | invoke | final, override, public | diff --git a/java/ql/test-kotlin2/library-tests/generic-instance-methods/test.expected b/java/ql/test-kotlin2/library-tests/generic-instance-methods/test.expected index d44d1d94c09..db82f1b79c5 100644 --- a/java/ql/test-kotlin2/library-tests/generic-instance-methods/test.expected +++ b/java/ql/test-kotlin2/library-tests/generic-instance-methods/test.expected @@ -6,8 +6,8 @@ calls | 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 | | 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 | | 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:12 | getStored | test.kt:1:1:13:1 | Generic | -| test.kt:8:26:8:39 | setStored(...) | test.kt:8:3:8:41 | setter | test.kt:1:1:13:1 | Generic | test.kt:3:3:3:12 | setStored | 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:39 | 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:44: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 | | test.kt:18:3: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 | | test.kt:19:3: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 | @@ -53,30 +53,30 @@ refTypes | 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 | file:///!unknown-binary-location/Generic.class:0:0:0:0 | callPrivateId | callPrivateId(Generic) | Generic | 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 | 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:12 | getStored | +| file:///!unknown-binary-location/Generic.class:0:0:0:0 | Generic | 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 | 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 | 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 | 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 | 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:12 | setStored | +| file:///!unknown-binary-location/Generic.class:0:0:0:0 | Generic | 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 | 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 | file:///!unknown-binary-location/Generic.class:0:0:0:0 | callPrivateId | callPrivateId(Generic) | Generic | 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 | 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:12 | getStored | +| file:///!unknown-binary-location/Generic.class:0:0:0:0 | Generic | 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 | 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 | 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 | 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 | 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:12 | setStored | +| file:///!unknown-binary-location/Generic.class:0:0:0:0 | Generic | 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 | 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 | file:///!unknown-binary-location/Generic.class:0:0:0:0 | callPrivateId | callPrivateId(Generic) | Generic | 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 | 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:12 | getStored | +| file:///!unknown-binary-location/Generic.class:0:0:0:0 | Generic | 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 | 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 | 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 | 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 | 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 | 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:12 | setStored | +| file:///!unknown-binary-location/Generic.class:0:0:0:0 | Generic | 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 | 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:12 | getStored | getStored() | No parameters | T | test.kt:1:1:13:1 | Generic | test.kt:3:3:3:12 | getStored | -| test.kt:1:1:13:1 | Generic | test.kt:3:3:3:12 | setStored | setStored(java.lang.Object) | T | void | test.kt:1:1:13:1 | Generic | test.kt:3:3:3:12 | setStored | +| 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 | diff --git a/java/ql/test-kotlin2/library-tests/generic-selective-extraction/test.expected b/java/ql/test-kotlin2/library-tests/generic-selective-extraction/test.expected index 7132c6915e9..82c3adffbbd 100644 --- a/java/ql/test-kotlin2/library-tests/generic-selective-extraction/test.expected +++ b/java/ql/test-kotlin2/library-tests/generic-selective-extraction/test.expected @@ -12,12 +12,12 @@ | Test.java:13:7:13:10 | User | Test.java:13:7:13:10 | User | | Test.java:13:7:13:10 | User | Test.java:15:22:15:25 | test | | Test.kt:1:1:8:1 | TestKt | Test.kt:1:1:8:1 | TestKt | -| Test.kt:1:1:8:1 | TestKt | Test.kt:3:3:3:15 | getField | -| Test.kt:1:1:8:1 | TestKt | Test.kt:3:3:3:15 | setField | | Test.kt:1:1:8:1 | TestKt | Test.kt:3:3:3:22 | field | -| Test.kt:1:1:8:1 | TestKt | Test.kt:5:3:5:18 | getRawField | -| Test.kt:1:1:8:1 | TestKt | Test.kt:5:3:5:18 | setRawField | +| Test.kt:1:1:8:1 | TestKt | Test.kt:3:3:3:22 | getField | +| Test.kt:1:1:8:1 | TestKt | Test.kt:3:3:3:22 | setField | +| Test.kt:1:1:8:1 | TestKt | Test.kt:5:3:5:25 | getRawField | | Test.kt:1:1:8:1 | TestKt | Test.kt:5:3:5:25 | rawField | +| Test.kt:1:1:8:1 | TestKt | Test.kt:5:3:5:25 | setRawField | | Test.kt:1:1:8:1 | TestKt | Test.kt:6:3:6:22 | method | | Test.kt:10:1:10:20 | FieldUsedKt | Test.kt:10:1:10:20 | FieldUsedKt | | Test.kt:11:1:11:23 | RawFieldUsedKt | Test.kt:11:1:11:23 | RawFieldUsedKt | diff --git a/java/ql/test-kotlin2/library-tests/internal-public-alias/test.expected b/java/ql/test-kotlin2/library-tests/internal-public-alias/test.expected index db1728f2335..77a06cf7310 100644 --- a/java/ql/test-kotlin2/library-tests/internal-public-alias/test.expected +++ b/java/ql/test-kotlin2/library-tests/internal-public-alias/test.expected @@ -1,6 +1,6 @@ | User.java:3:21:3:24 | test | -| test.kt:3:12:3:26 | getInternalVal$main | +| test.kt:3:12:3:30 | getInternalVal$main | | test.kt:6:3:6:36 | getInternalVal | -| test.kt:8:12:8:26 | getInternalVar$main | -| test.kt:8:12:8:26 | setInternalVar$main | +| test.kt:8:12:8:30 | getInternalVar$main | +| test.kt:8:12:8:30 | setInternalVar$main | | test.kt:10:12:10:32 | internalFun$main | diff --git a/java/ql/test-kotlin2/library-tests/java-kotlin-collection-type-generic-methods/test.expected b/java/ql/test-kotlin2/library-tests/java-kotlin-collection-type-generic-methods/test.expected index eba4613fba5..3237c89c8c7 100644 --- a/java/ql/test-kotlin2/library-tests/java-kotlin-collection-type-generic-methods/test.expected +++ b/java/ql/test-kotlin2/library-tests/java-kotlin-collection-type-generic-methods/test.expected @@ -16,14 +16,6 @@ methodWithDuplicate | AbstractCollection | removeAll | Collection | | AbstractCollection | retainAll | Collection | | AbstractCollection | toArray | T[] | -| AbstractCollection | add | Runnable | -| AbstractCollection | addAll | Collection | -| AbstractCollection | contains | Object | -| AbstractCollection | containsAll | Collection | -| AbstractCollection | remove | Object | -| AbstractCollection | removeAll | Collection | -| AbstractCollection | retainAll | Collection | -| AbstractCollection | toArray | T[] | | AbstractCollection | add | String | | AbstractCollection | addAll | Collection | | AbstractCollection | contains | Object | @@ -79,14 +71,14 @@ methodWithDuplicate | AbstractMap | put | V | | AbstractMap | putAll | Map | | AbstractMap | remove | Object | -| AbstractMap> | containsKey | Object | -| AbstractMap> | containsValue | Object | -| AbstractMap> | equals | Object | -| AbstractMap> | get | Object | -| AbstractMap> | put | Entry | -| AbstractMap> | put | Identity | -| AbstractMap> | putAll | Map> | -| AbstractMap> | remove | Object | +| AbstractMap | containsKey | Object | +| AbstractMap | containsValue | Object | +| AbstractMap | equals | Object | +| AbstractMap | get | Object | +| AbstractMap | put | Identity | +| AbstractMap | put | Object | +| AbstractMap | putAll | Map | +| AbstractMap | remove | Object | | AbstractMap | containsKey | Object | | AbstractMap | containsValue | Object | | AbstractMap | equals | Object | @@ -152,16 +144,6 @@ methodWithDuplicate | Collection | retainAll | Collection | | Collection | toArray | IntFunction | | Collection | toArray | T[] | -| Collection | add | Runnable | -| Collection | addAll | Collection | -| Collection | contains | Object | -| Collection | containsAll | Collection | -| Collection | remove | Object | -| Collection | removeAll | Collection | -| Collection | removeIf | Predicate | -| Collection | retainAll | Collection | -| Collection | toArray | IntFunction | -| Collection | toArray | T[] | | Collection | add | String | | Collection | addAll | Collection | | Collection | contains | Object | @@ -209,6 +191,8 @@ methodWithDuplicate | List | listIterator | int | | List | of | E | | List | of | E[] | +| List | ofLazy | IntFunction | +| List | ofLazy | int | | List | remove | Object | | List | remove | int | | List | removeAll | Collection | @@ -234,6 +218,8 @@ methodWithDuplicate | List | listIterator | int | | List | of | E | | List | of | E[] | +| List | ofLazy | IntFunction | +| List | ofLazy | int | | List | remove | Object | | List | remove | int | | List | removeAll | Collection | @@ -260,6 +246,8 @@ methodWithDuplicate | List | listIterator | int | | List | of | E | | List | of | E[] | +| List | ofLazy | IntFunction | +| List | ofLazy | int | | List | remove | Object | | List | remove | int | | List | removeAll | Collection | @@ -292,6 +280,8 @@ methodWithDuplicate | Map | of | K | | Map | of | V | | Map | ofEntries | Entry[] | +| Map | ofLazy | Function | +| Map | ofLazy | Set | | Map | put | K | | Map | put | V | | Map | putAll | Map | @@ -301,36 +291,37 @@ methodWithDuplicate | Map | replace | K | | Map | replace | V | | Map | replaceAll | BiFunction | -| Map> | compute | BiFunction,? extends Entry> | -| Map> | compute | Identity | -| Map> | computeIfAbsent | Function> | -| Map> | computeIfAbsent | Identity | -| Map> | computeIfPresent | BiFunction,? extends Entry> | -| Map> | computeIfPresent | Identity | -| Map> | containsKey | Object | -| Map> | containsValue | Object | -| Map> | copyOf | Map | -| Map> | entry | K | -| Map> | entry | V | -| Map> | forEach | BiConsumer> | -| Map> | get | Object | -| Map> | getOrDefault | Entry | -| Map> | getOrDefault | Object | -| Map> | merge | BiFunction,? super Entry,? extends Entry> | -| Map> | merge | Entry | -| Map> | merge | Identity | -| Map> | of | K | -| Map> | of | V | -| Map> | ofEntries | Entry[] | -| Map> | put | Entry | -| Map> | put | Identity | -| Map> | putAll | Map> | -| Map> | putIfAbsent | Entry | -| Map> | putIfAbsent | Identity | -| Map> | remove | Object | -| Map> | replace | Entry | -| Map> | replace | Identity | -| Map> | replaceAll | BiFunction,? extends Entry> | +| Map | compute | BiFunction | +| Map | compute | Identity | +| Map | computeIfAbsent | Function | +| Map | computeIfAbsent | Identity | +| Map | computeIfPresent | BiFunction | +| Map | computeIfPresent | Identity | +| Map | containsKey | Object | +| Map | containsValue | Object | +| Map | copyOf | Map | +| Map | entry | K | +| Map | entry | V | +| Map | forEach | BiConsumer | +| Map | get | Object | +| Map | getOrDefault | Object | +| Map | merge | BiFunction | +| Map | merge | Identity | +| Map | merge | Object | +| Map | of | K | +| Map | of | V | +| Map | ofEntries | Entry[] | +| Map | ofLazy | Function | +| Map | ofLazy | Set | +| Map | put | Identity | +| Map | put | Object | +| Map | putAll | Map | +| Map | putIfAbsent | Identity | +| Map | putIfAbsent | Object | +| Map | remove | Object | +| Map | replace | Identity | +| Map | replace | Object | +| Map | replaceAll | BiFunction | | Map | compute | BiFunction | | Map | compute | K | | Map | computeIfAbsent | Function | @@ -352,6 +343,8 @@ methodWithDuplicate | Map | of | K | | Map | of | V | | Map | ofEntries | Entry[] | +| Map | ofLazy | Function | +| Map | ofLazy | Set | | Map | put | K | | Map | put | V | | Map | putAll | Map | @@ -380,6 +373,8 @@ methodWithDuplicate | Map | of | K | | Map | of | V | | Map | ofEntries | Entry[] | +| Map | ofLazy | Function | +| Map | ofLazy | Set | | Map | put | Object | | Map | putAll | Map | | Map | putIfAbsent | Object | @@ -407,6 +402,8 @@ methodWithDuplicate | Map | of | K | | Map | of | V | | Map | ofEntries | Entry[] | +| Map | ofLazy | Function | +| Map | ofLazy | Set | | Map | put | String | | Map | putAll | Map | | Map | putIfAbsent | String | diff --git a/java/ql/test-kotlin2/library-tests/jvmstatic-annotation/test.expected b/java/ql/test-kotlin2/library-tests/jvmstatic-annotation/test.expected index 813562aa20d..a9c3d966600 100644 --- a/java/ql/test-kotlin2/library-tests/jvmstatic-annotation/test.expected +++ b/java/ql/test-kotlin2/library-tests/jvmstatic-annotation/test.expected @@ -10,8 +10,8 @@ staticMembers | test.kt:9:1:29:1 | HasCompanion | test.kt:25:7: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:35 | getStaticProp | Method | -| test.kt:31:1:47:1 | NonCompanion | test.kt:36:14:36:35 | setStaticProp | 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:5:40:43 | getPropWithStaticGetter | Method | | test.kt:31:1:47:1 | NonCompanion | test.kt:45:5:45:58 | setPropWithStaticSetter | Method | #select diff --git a/java/ql/test-kotlin2/library-tests/methods/exprs.expected b/java/ql/test-kotlin2/library-tests/methods/exprs.expected index fbe0ff41944..d4b8414390c 100644 --- a/java/ql/test-kotlin2/library-tests/methods/exprs.expected +++ b/java/ql/test-kotlin2/library-tests/methods/exprs.expected @@ -4,12 +4,12 @@ | clinit.kt:3:1:3:20 | ClinitKt | TypeAccess | | clinit.kt:3:1:3:20 | ClinitKt.topLevelInt | VarAccess | | clinit.kt:3:1:3:20 | ClinitKt.topLevelInt | VarAccess | -| clinit.kt:3:1:3:20 | Unit | TypeAccess | -| clinit.kt:3:1:3:20 | int | TypeAccess | -| clinit.kt:3:1:3:20 | int | TypeAccess | | clinit.kt:3:1:3:24 | ...=... | KtInitializerAssignExpr | | clinit.kt:3:1:3:24 | ClinitKt | TypeAccess | | clinit.kt:3:1:3:24 | ClinitKt.topLevelInt | VarAccess | +| clinit.kt:3:1:3:24 | Unit | TypeAccess | +| clinit.kt:3:1:3:24 | int | TypeAccess | +| clinit.kt:3:1:3:24 | int | TypeAccess | | clinit.kt:3:1:3:24 | int | TypeAccess | | clinit.kt:3:24:3:24 | 0 | IntegerLiteral | | dataClass.kt:0:0:0:0 | 0 | IntegerLiteral | diff --git a/java/ql/test-kotlin2/library-tests/methods/methods.expected b/java/ql/test-kotlin2/library-tests/methods/methods.expected index abd50a29c1f..0e171d94bef 100644 --- a/java/ql/test-kotlin2/library-tests/methods/methods.expected +++ b/java/ql/test-kotlin2/library-tests/methods/methods.expected @@ -1,7 +1,7 @@ methods | clinit.kt:0:0:0:0 | ClinitKt | clinit.kt:0:0:0:0 | | () | static | Compiler generated | -| clinit.kt:0:0:0:0 | ClinitKt | clinit.kt:3:1:3:20 | getTopLevelInt | getTopLevelInt() | final, public, static | Compiler generated | -| clinit.kt:0:0:0:0 | ClinitKt | clinit.kt:3:1:3:20 | setTopLevelInt | setTopLevelInt(int) | final, public, static | Compiler generated | +| clinit.kt:0:0:0:0 | ClinitKt | clinit.kt:3:1:3:24 | getTopLevelInt | getTopLevelInt() | final, public, static | Compiler generated | +| clinit.kt:0:0:0:0 | ClinitKt | clinit.kt:3:1:3:24 | setTopLevelInt | setTopLevelInt(int) | final, public, static | Compiler generated | | dataClass.kt:1:1:1:47 | DataClass | dataClass.kt:0:0:0:0 | component1 | component1() | final, public | Compiler generated | | dataClass.kt:1:1:1:47 | DataClass | dataClass.kt:0:0:0:0 | component2 | component2() | final, public | Compiler generated | | dataClass.kt:1:1:1:47 | DataClass | dataClass.kt:0:0:0:0 | copy | copy(int,java.lang.String) | final, public | Compiler generated | diff --git a/java/ql/test-kotlin2/library-tests/methods/parameters.expected b/java/ql/test-kotlin2/library-tests/methods/parameters.expected index b26345a228d..989dd0fac8b 100644 --- a/java/ql/test-kotlin2/library-tests/methods/parameters.expected +++ b/java/ql/test-kotlin2/library-tests/methods/parameters.expected @@ -1,4 +1,4 @@ -| clinit.kt:3:1:3:20 | setTopLevelInt | clinit.kt:3:1:3:20 | | 0 | +| clinit.kt:3:1:3:24 | setTopLevelInt | clinit.kt:3:1:3:24 | | 0 | | dataClass.kt:0:0:0:0 | copy | dataClass.kt:0:0:0:0 | x | 0 | | dataClass.kt:0:0:0:0 | copy | dataClass.kt:0:0:0:0 | y | 1 | | dataClass.kt:0:0:0:0 | copy$default | dataClass.kt:0:0:0:0 | p0 | 0 | diff --git a/java/ql/test-kotlin2/library-tests/modifiers/modifiers.expected b/java/ql/test-kotlin2/library-tests/modifiers/modifiers.expected index 4fc6ff961db..87ff0a63f5a 100644 --- a/java/ql/test-kotlin2/library-tests/modifiers/modifiers.expected +++ b/java/ql/test-kotlin2/library-tests/modifiers/modifiers.expected @@ -1,33 +1,33 @@ | modifiers.kt:1:1:29:1 | X | Class | public | | modifiers.kt:1:1:29:1 | X | Constructor | public | -| modifiers.kt:2:13:2:17 | getA$private | Method | final | -| modifiers.kt:2:13:2:17 | getA$private | Method | private | | modifiers.kt:2:13:2:21 | a | Field | final | | modifiers.kt:2:13:2:21 | a | Field | private | | modifiers.kt:2:13:2:21 | a | Property | private | -| modifiers.kt:3:15:3:19 | getB | Method | final | -| modifiers.kt:3:15:3:19 | getB | Method | protected | +| modifiers.kt:2:13:2:21 | getA$private | Method | final | +| modifiers.kt:2:13:2:21 | getA$private | Method | private | | modifiers.kt:3:15:3:23 | b | Field | final | | modifiers.kt:3:15:3:23 | b | Field | private | | modifiers.kt:3:15:3:23 | b | Property | protected | -| modifiers.kt:4:14:4:18 | getC$main | Method | final | -| modifiers.kt:4:14:4:18 | getC$main | Method | internal | +| modifiers.kt:3:15:3:23 | getB | Method | final | +| modifiers.kt:3:15:3:23 | getB | Method | protected | | modifiers.kt:4:14:4:22 | c | Field | final | | modifiers.kt:4:14:4:22 | c | Field | private | | modifiers.kt:4:14:4:22 | c | Property | internal | -| modifiers.kt:5:5:5:9 | getD | Method | final | -| modifiers.kt:5:5:5:9 | getD | Method | public | +| modifiers.kt:4:14:4:22 | getC$main | Method | final | +| modifiers.kt:4:14:4:22 | getC$main | Method | internal | | modifiers.kt:5:5:5:34 | d | Field | final | | modifiers.kt:5:5:5:34 | d | Field | private | | modifiers.kt:5:5:5:34 | d | Property | public | +| modifiers.kt:5:5:5:34 | getD | Method | final | +| modifiers.kt:5:5:5:34 | getD | Method | public | | modifiers.kt:7:5:9:5 | Nested | Class | final | | modifiers.kt:7:5:9:5 | Nested | Class | protected | | modifiers.kt:7:5:9:5 | Nested | Constructor | public | -| modifiers.kt:8:16:8:25 | getE | Method | final | -| modifiers.kt:8:16:8:25 | getE | Method | public | | modifiers.kt:8:16:8:29 | e | Field | final | | modifiers.kt:8:16:8:29 | e | Field | private | | modifiers.kt:8:16:8:29 | e | Property | public | +| modifiers.kt:8:16:8:29 | getE | Method | final | +| modifiers.kt:8:16:8:29 | getE | Method | public | | modifiers.kt:11:5:15:5 | fn1 | Method | final | | modifiers.kt:11:5:15:5 | fn1 | Method | public | | modifiers.kt:12:16:14:9 | | Constructor | public | diff --git a/java/ql/test-kotlin2/library-tests/numlines/callable.expected b/java/ql/test-kotlin2/library-tests/numlines/callable.expected index ca6371ce23e..52f3a4f2cbe 100644 --- a/java/ql/test-kotlin2/library-tests/numlines/callable.expected +++ b/java/ql/test-kotlin2/library-tests/numlines/callable.expected @@ -1,6 +1,6 @@ | test.kt:2:1:4:1 | foo | 3 | 3 | 0 | -| test.kt:8:1:8:5 | getX | 1 | 1 | 0 | -| test.kt:18:1:18:5 | getY | 5 | 1 | 4 | +| test.kt:8:1:8:9 | getX | 1 | 1 | 0 | +| test.kt:18:1:18:17 | getY | 5 | 1 | 4 | | test.kt:20:1:26:1 | Foo | 7 | 6 | 1 | | test.kt:21:5:24:5 | bar | 4 | 3 | 1 | -| test.kt:25:5:25:17 | getSomeField | 1 | 1 | 0 | +| test.kt:25:5:25:21 | getSomeField | 1 | 1 | 0 | diff --git a/java/ql/test-kotlin2/library-tests/private-anonymous-types/test.expected b/java/ql/test-kotlin2/library-tests/private-anonymous-types/test.expected index c87337a92c7..8b87d9c369e 100644 --- a/java/ql/test-kotlin2/library-tests/private-anonymous-types/test.expected +++ b/java/ql/test-kotlin2/library-tests/private-anonymous-types/test.expected @@ -17,16 +17,16 @@ | 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:22:1 | A | test.kt:7:16:7:21 | A | -| test.kt:7:1:22:1 | A | test.kt:9:3:9:14 | getAnonType | | test.kt:7:1:22:1 | A | test.kt:9:3:11:3 | anonType | -| test.kt:7:1:22:1 | A | test.kt:13:11:13:29 | getPrivateAnonType$private | +| test.kt:7:1:22:1 | A | test.kt:9:3:11:3 | getAnonType | +| test.kt:7:1:22:1 | A | test.kt:13:11:15:3 | getPrivateAnonType$private | | test.kt:7:1:22:1 | A | test.kt:13:11:15:3 | privateAnonType | | test.kt:7:1:22:1 | A | test.kt:17:3:20:3 | privateUser | | test.kt:9:18:11:3 | new If(...) { ... } | test.kt:9:18:11:3 | | -| test.kt:9:18:11:3 | new If(...) { ... } | test.kt:10:14:10:18 | getX | +| test.kt:9:18:11:3 | new If(...) { ... } | test.kt:10:14:10:22 | getX | | test.kt:9:18:11:3 | new If(...) { ... } | test.kt:10:14:10:22 | x | | test.kt:13:33:15:3 | new If(...) { ... } | test.kt:13:33:15:3 | | -| test.kt:13:33:15:3 | new If(...) { ... } | test.kt:14:14:14:18 | getX | +| test.kt:13:33:15:3 | new If(...) { ... } | test.kt:14:14:14:22 | getX | | test.kt:13:33:15:3 | new If(...) { ... } | test.kt:14:14:14:22 | x | enclosingTypes | file:///!unknown-binary-location/A$.class:0:0:0:0 | new If(...) { ... }<> | file:///!unknown-binary-location/A.class:0:0:0:0 | A | diff --git a/java/ql/test-kotlin2/library-tests/properties/properties.expected b/java/ql/test-kotlin2/library-tests/properties/properties.expected index 705427f13a8..2a42912654f 100644 --- a/java/ql/test-kotlin2/library-tests/properties/properties.expected +++ b/java/ql/test-kotlin2/library-tests/properties/properties.expected @@ -1,33 +1,33 @@ #select | properties.kt:2:27:2:50 | constructorProp | properties.kt:2:27:2:50 | getConstructorProp | file://:0:0:0:0 | | properties.kt:2:27:2:50 | constructorProp | public | | properties.kt:2:53:2:83 | mutableConstructorProp | properties.kt:2:53:2:83 | getMutableConstructorProp | properties.kt:2:53:2:83 | setMutableConstructorProp | properties.kt:2:53:2:83 | mutableConstructorProp | public | -| properties.kt:3:5:3:25 | modifiableInt | properties.kt:3:5:3:21 | getModifiableInt | properties.kt:3:5:3:21 | setModifiableInt | properties.kt:3:5:3:25 | modifiableInt | public | -| properties.kt:4:5:4:24 | immutableInt | properties.kt:4:5:4:20 | getImmutableInt | file://:0:0:0:0 | | properties.kt:4:5:4:24 | immutableInt | public | -| properties.kt:5:5:5:26 | typedProp | properties.kt:5:5:5:22 | getTypedProp | file://:0:0:0:0 | | properties.kt:5:5:5:26 | typedProp | public | +| properties.kt:3:5:3:25 | modifiableInt | properties.kt:3:5:3:25 | getModifiableInt | properties.kt:3:5:3:25 | setModifiableInt | properties.kt:3:5:3:25 | modifiableInt | public | +| properties.kt:4:5:4:24 | immutableInt | properties.kt:4:5:4:24 | getImmutableInt | file://:0:0:0:0 | | properties.kt:4:5:4:24 | immutableInt | public | +| properties.kt:5:5:5:26 | typedProp | properties.kt:5:5:5:26 | getTypedProp | file://:0:0:0:0 | | properties.kt:5:5:5:26 | typedProp | public | | properties.kt:6:14:6:38 | abstractTypeProp | properties.kt:6:14:6:38 | getAbstractTypeProp | file://:0:0:0:0 | | file://:0:0:0:0 | | public | | properties.kt:7:5:7:30 | initialisedInInit | properties.kt:7:5:7:30 | getInitialisedInInit | file://:0:0:0:0 | | properties.kt:7:5:7:30 | initialisedInInit | public | -| properties.kt:11:5:11:40 | useConstructorArg | properties.kt:11:5:11:25 | getUseConstructorArg | file://:0:0:0:0 | | properties.kt:11:5:11:40 | useConstructorArg | public | +| properties.kt:11:5:11:40 | useConstructorArg | properties.kt:11:5:11:40 | getUseConstructorArg | file://:0:0:0:0 | | properties.kt:11:5:11:40 | useConstructorArg | public | | properties.kt:12:5:13:21 | five | properties.kt:13:13:13:21 | getFive | file://:0:0:0:0 | | file://:0:0:0:0 | | public | | properties.kt:14:5:15:21 | six | properties.kt:15:13:15:21 | getSix | file://:0:0:0:0 | | file://:0:0:0:0 | | public | | properties.kt:16:5:18:40 | getSet | properties.kt:17:13:17:33 | getGetSet | properties.kt:18:13:18:40 | setGetSet | file://:0:0:0:0 | | public | -| properties.kt:19:5:20:15 | defaultGetter | properties.kt:20:13:20:15 | getDefaultGetter | file://:0:0:0:0 | | properties.kt:19:5:20:15 | defaultGetter | public | -| properties.kt:21:5:22:15 | varDefaultGetter | properties.kt:22:13:22:15 | getVarDefaultGetter | properties.kt:21:5:21:24 | setVarDefaultGetter | properties.kt:21:5:22:15 | varDefaultGetter | public | -| properties.kt:23:5:24:15 | varDefaultSetter | properties.kt:23:5:23:24 | getVarDefaultSetter | properties.kt:24:13:24:15 | setVarDefaultSetter | properties.kt:23:5:24:15 | varDefaultSetter | public | -| properties.kt:25:5:27:15 | varDefaultGetterSetter | properties.kt:26:13:26:15 | getVarDefaultGetterSetter | properties.kt:27:13:27:15 | setVarDefaultGetterSetter | properties.kt:25:5:27:15 | varDefaultGetterSetter | public | -| properties.kt:28:5:29:22 | overrideGetter | properties.kt:29:13:29:22 | getOverrideGetter | properties.kt:28:5:28:22 | setOverrideGetter | properties.kt:28:5:29:22 | overrideGetter | public | -| properties.kt:30:5:31:29 | overrideGetterUseField | properties.kt:31:13:31:29 | getOverrideGetterUseField | properties.kt:30:5:30:30 | setOverrideGetterUseField | properties.kt:30:5:31:29 | overrideGetterUseField | public | +| properties.kt:19:5:20:15 | defaultGetter | properties.kt:19:5:20:15 | getDefaultGetter | file://:0:0:0:0 | | properties.kt:19:5:20:15 | defaultGetter | public | +| properties.kt:21:5:22:15 | varDefaultGetter | properties.kt:21:5:22:15 | getVarDefaultGetter | properties.kt:21:5:22:15 | setVarDefaultGetter | properties.kt:21:5:22:15 | varDefaultGetter | public | +| properties.kt:23:5:24:15 | varDefaultSetter | properties.kt:23:5:24:15 | getVarDefaultSetter | properties.kt:23:5:24:15 | setVarDefaultSetter | properties.kt:23:5:24:15 | varDefaultSetter | public | +| properties.kt:25:5:27:15 | varDefaultGetterSetter | properties.kt:25:5:27:15 | getVarDefaultGetterSetter | properties.kt:25:5:27:15 | setVarDefaultGetterSetter | properties.kt:25:5:27:15 | varDefaultGetterSetter | public | +| properties.kt:28:5:29:22 | overrideGetter | properties.kt:29:13:29:22 | getOverrideGetter | properties.kt:28:5:29:22 | setOverrideGetter | properties.kt:28:5:29:22 | overrideGetter | public | +| properties.kt:30:5:31:29 | overrideGetterUseField | properties.kt:31:13:31:29 | getOverrideGetterUseField | properties.kt:30:5:31:29 | setOverrideGetterUseField | properties.kt:30:5:31:29 | overrideGetterUseField | public | | properties.kt:32:5:33:29 | useField | properties.kt:33:13:33:29 | getUseField | file://:0:0:0:0 | | properties.kt:32:5:33:29 | useField | public | | properties.kt:34:14:34:36 | lateInitVar | properties.kt:34:14:34:36 | getLateInitVar | properties.kt:34:14:34:36 | setLateInitVar | properties.kt:34:14:34:36 | lateInitVar | lateinit, public | -| properties.kt:35:13:35:32 | privateProp | properties.kt:35:13:35:27 | getPrivateProp$private | file://:0:0:0:0 | | properties.kt:35:13:35:32 | privateProp | private | -| properties.kt:36:15:36:36 | protectedProp | properties.kt:36:15:36:31 | getProtectedProp | file://:0:0:0:0 | | properties.kt:36:15:36:36 | protectedProp | protected | -| properties.kt:37:12:37:30 | publicProp | properties.kt:37:12:37:25 | getPublicProp | file://:0:0:0:0 | | properties.kt:37:12:37:30 | publicProp | public | -| properties.kt:38:14:38:34 | internalProp | properties.kt:38:14:38:29 | getInternalProp$main | file://:0:0:0:0 | | properties.kt:38:14:38:34 | internalProp | internal | -| properties.kt:67:7:67:23 | constVal | properties.kt:67:7:67:18 | getConstVal | file://:0:0:0:0 | | properties.kt:67:7:67:23 | constVal | public | -| properties.kt:70:5:70:16 | prop | properties.kt:70:5:70:12 | getProp | file://:0:0:0:0 | | properties.kt:70:5:70:16 | prop | public | +| properties.kt:35:13:35:32 | privateProp | properties.kt:35:13:35:32 | getPrivateProp$private | file://:0:0:0:0 | | properties.kt:35:13:35:32 | privateProp | private | +| properties.kt:36:15:36:36 | protectedProp | properties.kt:36:15:36:36 | getProtectedProp | file://:0:0:0:0 | | properties.kt:36:15:36:36 | protectedProp | protected | +| properties.kt:37:12:37:30 | publicProp | properties.kt:37:12:37:30 | getPublicProp | file://:0:0:0:0 | | properties.kt:37:12:37:30 | publicProp | public | +| properties.kt:38:14:38:34 | internalProp | properties.kt:38:14:38:34 | getInternalProp$main | file://:0:0:0:0 | | properties.kt:38:14:38:34 | internalProp | internal | +| properties.kt:67:7:67:23 | constVal | properties.kt:67:7:67:23 | getConstVal | file://:0:0:0:0 | | properties.kt:67:7:67:23 | constVal | public | +| properties.kt:70:5:70:16 | prop | properties.kt:70:5:70:16 | getProp | file://:0:0:0:0 | | properties.kt:70:5:70:16 | prop | public | | properties.kt:78:1:79:13 | x | properties.kt:79:5:79:13 | getX | file://:0:0:0:0 | | file://:0:0:0:0 | | public | | properties.kt:80:1:81:13 | x | properties.kt:81:5:81:13 | getX | file://:0:0:0:0 | | file://:0:0:0:0 | | public | -| properties.kt:84:13:84:29 | data | properties.kt:84:13:84:25 | getData$private | properties.kt:84:13:84:25 | setData$private | properties.kt:84:13:84:29 | data | private | -| properties.kt:92:13:93:18 | data | properties.kt:93:9:93:18 | getData | properties.kt:92:13:92:25 | setData$private | properties.kt:92:13:93:18 | data | private | +| properties.kt:84:13:84:29 | data | properties.kt:84:13:84:29 | getData$private | properties.kt:84:13:84:29 | setData$private | properties.kt:84:13:84:29 | data | private | +| properties.kt:92:13:93:18 | data | properties.kt:93:9:93:18 | getData | properties.kt:92:13:93:18 | setData$private | properties.kt:92:13:93:18 | data | private | fieldDeclarations | properties.kt:2:27:2:50 | int constructorProp; | properties.kt:2:27:2:50 | constructorProp | 0 | | properties.kt:2:53:2:83 | int mutableConstructorProp; | properties.kt:2:53:2:83 | mutableConstructorProp | 0 | diff --git a/java/ql/test-kotlin2/library-tests/reflection/reflection.expected b/java/ql/test-kotlin2/library-tests/reflection/reflection.expected index 5ab8541ff95..92a83c033f9 100644 --- a/java/ql/test-kotlin2/library-tests/reflection/reflection.expected +++ b/java/ql/test-kotlin2/library-tests/reflection/reflection.expected @@ -59,10 +59,10 @@ functionReferences | reflection.kt:154:33:154:61 | ...::... | reflection.kt:154:33:154:61 | invoke | reflection.kt:154:33:154:61 | extTakesOptionalParam | | reflection.kt:162:25:162:45 | ...::... | reflection.kt:162:25:162:45 | invoke | reflection.kt:162:25:162:45 | | propertyGetReferences -| reflection.kt:10:38:10:42 | ...::... | reflection.kt:10:38:10:42 | get | reflection.kt:33:9:33:19 | getP0 | -| reflection.kt:15:35:15:41 | ...::... | reflection.kt:15:35:15:41 | get | reflection.kt:33:9:33:19 | getP0 | -| reflection.kt:17:45:17:49 | ...::... | reflection.kt:17:45:17:49 | get | reflection.kt:34:9:34:19 | getP1 | -| reflection.kt:22:42:22:48 | ...::... | reflection.kt:22:42:22:48 | get | reflection.kt:34:9:34:19 | getP1 | +| reflection.kt:10:38:10:42 | ...::... | reflection.kt:10:38:10:42 | get | reflection.kt:33:9:33:23 | getP0 | +| reflection.kt:15:35:15:41 | ...::... | reflection.kt:15:35:15:41 | get | reflection.kt:33:9:33:23 | getP0 | +| reflection.kt:17:45:17:49 | ...::... | reflection.kt:17:45:17:49 | get | reflection.kt:34:9:34:23 | getP1 | +| reflection.kt:22:42:22:48 | ...::... | reflection.kt:22:42:22:48 | get | reflection.kt:34:9:34:23 | getP1 | | reflection.kt:50:13:50:28 | ...::... | reflection.kt:50:13:50:28 | get | reflection.kt:47:5:47:28 | getLastChar | | reflection.kt:51:13:51:28 | ...::... | reflection.kt:51:13:51:28 | get | reflection.kt:47:5:47:28 | getLastChar | | reflection.kt:67:17:67:32 | ...::... | reflection.kt:67:17:67:32 | get | file:///Class1$Generic.class:0:0:0:0 | getP2 | @@ -73,8 +73,8 @@ propertyFieldReferences | reflection.kt:71:17:71:34 | ...::... | reflection.kt:71:17:71:34 | get | file:///modules/java.base/java/lang/Integer.class:0:0:0:0 | MAX_VALUE | | reflection.kt:72:17:72:35 | ...::... | reflection.kt:72:17:72:35 | get | file:///modules/java.desktop/java/awt/Rectangle.class:0:0:0:0 | height | propertySetReferences -| reflection.kt:17:45:17:49 | ...::... | reflection.kt:17:45:17:49 | set | reflection.kt:34:9:34:19 | setP1 | -| reflection.kt:22:42:22:48 | ...::... | reflection.kt:22:42:22:48 | set | reflection.kt:34:9:34:19 | setP1 | +| reflection.kt:17:45:17:49 | ...::... | reflection.kt:17:45:17:49 | set | reflection.kt:34:9:34:23 | setP1 | +| reflection.kt:22:42:22:48 | ...::... | reflection.kt:22:42:22:48 | set | reflection.kt:34:9:34:23 | setP1 | | reflection.kt:67:17:67:32 | ...::... | reflection.kt:67:17:67:32 | set | file:///Class1$Generic.class:0:0:0:0 | setP2 | | reflection.kt:68:17:68:34 | ...::... | reflection.kt:68:17:68:34 | set | file:///Class1$Generic.class:0:0:0:0 | setP2 | | reflection.kt:109:17:109:27 | ...::... | reflection.kt:109:17:109:27 | set | reflection.kt:105:18:105:31 | setProp1 | @@ -266,6 +266,7 @@ compGenerated | file:///AccessFlag$Location.class:0:0:0:0 | getEntries | Default property accessor | | file:///AccessFlag.class:0:0:0:0 | getEntries | Default property accessor | | file:///AccessMode.class:0:0:0:0 | getEntries | Default property accessor | +| file:///ByteOrder.class:0:0:0:0 | getEntries | Default property accessor | | file:///CharProgression.class:0:0:0:0 | forEach | Forwarder for a Kotlin class inheriting an interface default method | | file:///CharProgression.class:0:0:0:0 | spliterator | Forwarder for a Kotlin class inheriting an interface default method | | file:///CharRange.class:0:0:0:0 | forEach | Forwarder for a Kotlin class inheriting an interface default method | @@ -329,10 +330,12 @@ compGenerated | file:///SignStyle.class:0:0:0:0 | getEntries | Default property accessor | | file:///StackWalker$ExtendedOption.class:0:0:0:0 | getEntries | Default property accessor | | file:///StackWalker$Option.class:0:0:0:0 | getEntries | Default property accessor | +| file:///String.class:0:0:0:0 | getChars | Forwarder for a Kotlin class inheriting an interface default method | | file:///String.class:0:0:0:0 | isEmpty | Forwarder for a Kotlin class inheriting an interface default method | | file:///TextStyle.class:0:0:0:0 | getEntries | Default property accessor | | file:///Thread$State.class:0:0:0:0 | getEntries | Default property accessor | | file:///TimeUnit.class:0:0:0:0 | getEntries | Default property accessor | +| file:///TypeKind.class:0:0:0:0 | getEntries | Default property accessor | | file:///VarHandle$AccessMode.class:0:0:0:0 | getEntries | Default property accessor | | file:///VarHandle$AccessType.class:0:0:0:0 | getEntries | Default property accessor | | file:///Wrapper.class:0:0:0:0 | getEntries | Default property accessor | @@ -345,9 +348,9 @@ compGenerated | reflection.kt:21:44:21:50 | new Function2(...) { ... } | The class around a local function, a lambda, or a function reference | | reflection.kt:22:42:22:48 | new KMutableProperty0(...) { ... } | The class around a local function, a lambda, or a function reference | | reflection.kt:24:46:24:64 | new Function1,Boolean>(...) { ... } | The class around a local function, a lambda, or a function reference | -| reflection.kt:33:9:33:19 | getP0 | Default property accessor | -| reflection.kt:34:9:34:19 | getP1 | Default property accessor | -| reflection.kt:34:9:34:19 | setP1 | Default property accessor | +| reflection.kt:33:9:33:23 | getP0 | Default property accessor | +| reflection.kt:34:9:34:23 | getP1 | Default property accessor | +| reflection.kt:34:9:34:23 | setP1 | Default property accessor | | reflection.kt:50:13:50:28 | new KProperty1(...) { ... } | The class around a local function, a lambda, or a function reference | | reflection.kt:51:13:51:28 | new KProperty0(...) { ... } | The class around a local function, a lambda, or a function reference | | reflection.kt:60:17:60:32 | new Function2,Integer,String>(...) { ... } | The class around a local function, a lambda, or a function reference |