Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit bfcd553

Browse files
tamasvajkigfoo
authored andcommitted
Change location of properties inside parameterized types
1 parent 0726b64 commit bfcd553

3 files changed

Lines changed: 11 additions & 1 deletion

File tree

java/kotlin-extractor/src/main/kotlin/KotlinFileExtractor.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -745,7 +745,7 @@ open class KotlinFileExtractor(
745745
DeclarationStackAdjuster(p).use {
746746

747747
val id = useProperty(p, parentId)
748-
val locId = tw.getLocation(p)
748+
val locId = getLocation(p, classTypeArgs)
749749
tw.writeKtProperties(id, p.name.asString())
750750
tw.writeHasLocation(id, locId)
751751

java/ql/test/kotlin/library-tests/properties/properties.expected

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ fieldDeclarations
1919
| properties.kt:37:5:37:30 | int publicProp; | properties.kt:37:5:37:30 | publicProp | 0 |
2020
| properties.kt:38:5:38:34 | int internalProp; | properties.kt:38:5:38:34 | internalProp | 0 |
2121
| properties.kt:67:1:67:23 | int constVal; | properties.kt:67:1:67:23 | constVal | 0 |
22+
| properties.kt:70:5:70:16 | int prop; | properties.kt:70:5:70:16 | prop | 0 |
2223
#select
2324
| properties.kt:2:27:2:50 | constructorProp | properties.kt:2:27:2:50 | getConstructorProp | file://:0:0:0:0 | <none> | properties.kt:2:27:2:50 | constructorProp | public |
2425
| 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 |
@@ -44,3 +45,4 @@ fieldDeclarations
4445
| properties.kt:37:5:37:30 | publicProp | properties.kt:37:12:37:30 | getPublicProp | file://:0:0:0:0 | <none> | properties.kt:37:5:37:30 | publicProp | public |
4546
| properties.kt:38:5:38:34 | internalProp | properties.kt:38:14:38:34 | getInternalProp | file://:0:0:0:0 | <none> | properties.kt:38:5:38:34 | internalProp | internal |
4647
| properties.kt:67:1:67:23 | constVal | properties.kt:67:7:67:23 | getConstVal | file://:0:0:0:0 | <none> | properties.kt:67:1:67:23 | constVal | public |
48+
| properties.kt:70:5:70:16 | prop | properties.kt:70:5:70:16 | getProp | file://:0:0:0:0 | <none> | properties.kt:70:5:70:16 | prop | public |

java/ql/test/kotlin/library-tests/properties/properties.kt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,3 +65,11 @@ abstract class properties(val constructorProp: Int, var mutableConstructorProp:
6565
}
6666

6767
const val constVal = 15
68+
69+
class C<T> {
70+
val prop = 1
71+
fun fn() {
72+
val c = C<String>()
73+
println(c.prop)
74+
}
75+
}

0 commit comments

Comments
 (0)