mirror of
https://github.com/github/codeql.git
synced 2026-07-15 08:18:18 +02:00
Synthesised and bare `get`/`set` accessors were extracted with different
source locations depending on the frontend:
val typedProp: Int = 3 // getTypedProp
K1: 5:5:5:17 (val..name) K2: 5:5:5:22 (val..type)
val defaultGetter = 7
get // getDefaultGetter
K1: 19:5:19:21 (property head) K2: 20:13:20:15 (`get` keyword)
Under K2 the extractor has no PSI back-mapping for these accessors
(`getKtFile` returns null), so it cannot reproduce K1's property-name-end
span; K2 instead falls back to the raw IR offsets. Rather than converge on a
value K2 cannot produce, K1 is made to match the K2-native spans via the PSI:
* a bare `get`/`set` keyword now points at the keyword token; and
* a fully synthesised accessor now spans the property signature
(`val`/`var` .. type annotation, or .. name when untyped), excluding the
initialiser.
Explicit-body accessors (`get() = 5`) are unaffected: they are located at
their body and never take this override.
Only K1 output changes; the test-kotlin2 (K2) expected files are unchanged.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
53 lines
4.9 KiB
Plaintext
53 lines
4.9 KiB
Plaintext
| Test.class:0:0:0:0 | Test<ConstructorUsed> | Test.class:0:0:0:0 | Test<ConstructorUsed> |
|
|
| Test.class:0:0:0:0 | Test<ConstructorUsed> | Test.class:0:0:0:0 | method |
|
|
| Test.class:0:0:0:0 | Test<MethodUsed> | Test.class:0:0:0:0 | Test<MethodUsed> |
|
|
| Test.class:0:0:0:0 | Test<MethodUsed> | Test.class:0:0:0:0 | method |
|
|
| Test.java:1:14:1:17 | Test | Test.java:1:14:1:17 | Test |
|
|
| Test.java:1:14:1:17 | Test | Test.java:3:12:3:16 | field |
|
|
| Test.java:1:14:1:17 | Test | Test.java:4:12:4:17 | method |
|
|
| Test.java:8:7:8:15 | FieldUsed | Test.java:8:7:8:15 | FieldUsed |
|
|
| Test.java:9:7:9:16 | MethodUsed | Test.java:9:7:9:16 | MethodUsed |
|
|
| Test.java:10:7:10:21 | ConstructorUsed | Test.java:10:7:10:21 | ConstructorUsed |
|
|
| Test.java:11:7:11:17 | NeitherUsed | Test.java:11:7:11:17 | NeitherUsed |
|
|
| 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:5:3:5:25 | rawField |
|
|
| 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 |
|
|
| Test.kt:12:1:12:21 | MethodUsedKt | Test.kt:12:1:12:21 | MethodUsedKt |
|
|
| Test.kt:13:1:13:26 | ConstructorUsedKt | Test.kt:13:1:13:26 | ConstructorUsedKt |
|
|
| Test.kt:14:1:14:22 | NeitherUsedKt | Test.kt:14:1:14:22 | NeitherUsedKt |
|
|
| Test.kt:16:1:27:1 | UserKt | Test.kt:16:1:27:1 | UserKt |
|
|
| Test.kt:16:1:27:1 | UserKt | Test.kt:18:3:25:3 | test |
|
|
| file:///!unknown-binary-location/TestKt.class:0:0:0:0 | TestKt<ConstructorUsedKt> | Test.kt:3:3:3:15 | getField |
|
|
| file:///!unknown-binary-location/TestKt.class:0:0:0:0 | TestKt<ConstructorUsedKt> | Test.kt:3:3:3:15 | setField |
|
|
| file:///!unknown-binary-location/TestKt.class:0:0:0:0 | TestKt<ConstructorUsedKt> | Test.kt:5:3:5:18 | getRawField |
|
|
| file:///!unknown-binary-location/TestKt.class:0:0:0:0 | TestKt<ConstructorUsedKt> | Test.kt:5:3:5:18 | setRawField |
|
|
| file:///!unknown-binary-location/TestKt.class:0:0:0:0 | TestKt<ConstructorUsedKt> | file:///!unknown-binary-location/TestKt.class:0:0:0:0 | TestKt<ConstructorUsedKt> |
|
|
| file:///!unknown-binary-location/TestKt.class:0:0:0:0 | TestKt<ConstructorUsedKt> | file:///!unknown-binary-location/TestKt.class:0:0:0:0 | method |
|
|
| file:///!unknown-binary-location/TestKt.class:0:0:0:0 | TestKt<FieldUsedKt> | Test.kt:3:3:3:15 | getField |
|
|
| file:///!unknown-binary-location/TestKt.class:0:0:0:0 | TestKt<FieldUsedKt> | Test.kt:3:3:3:15 | setField |
|
|
| file:///!unknown-binary-location/TestKt.class:0:0:0:0 | TestKt<FieldUsedKt> | Test.kt:5:3:5:18 | getRawField |
|
|
| file:///!unknown-binary-location/TestKt.class:0:0:0:0 | TestKt<FieldUsedKt> | Test.kt:5:3:5:18 | setRawField |
|
|
| file:///!unknown-binary-location/TestKt.class:0:0:0:0 | TestKt<FieldUsedKt> | file:///!unknown-binary-location/TestKt.class:0:0:0:0 | TestKt<FieldUsedKt> |
|
|
| file:///!unknown-binary-location/TestKt.class:0:0:0:0 | TestKt<FieldUsedKt> | file:///!unknown-binary-location/TestKt.class:0:0:0:0 | method |
|
|
| file:///!unknown-binary-location/TestKt.class:0:0:0:0 | TestKt<MethodUsedKt> | Test.kt:3:3:3:15 | getField |
|
|
| file:///!unknown-binary-location/TestKt.class:0:0:0:0 | TestKt<MethodUsedKt> | Test.kt:3:3:3:15 | setField |
|
|
| file:///!unknown-binary-location/TestKt.class:0:0:0:0 | TestKt<MethodUsedKt> | Test.kt:5:3:5:18 | getRawField |
|
|
| file:///!unknown-binary-location/TestKt.class:0:0:0:0 | TestKt<MethodUsedKt> | Test.kt:5:3:5:18 | setRawField |
|
|
| file:///!unknown-binary-location/TestKt.class:0:0:0:0 | TestKt<MethodUsedKt> | file:///!unknown-binary-location/TestKt.class:0:0:0:0 | TestKt<MethodUsedKt> |
|
|
| file:///!unknown-binary-location/TestKt.class:0:0:0:0 | TestKt<MethodUsedKt> | file:///!unknown-binary-location/TestKt.class:0:0:0:0 | method |
|
|
| file:///!unknown-binary-location/TestKt.class:0:0:0:0 | TestKt<RawFieldUsedKt> | Test.kt:3:3:3:15 | getField |
|
|
| file:///!unknown-binary-location/TestKt.class:0:0:0:0 | TestKt<RawFieldUsedKt> | Test.kt:3:3:3:15 | setField |
|
|
| file:///!unknown-binary-location/TestKt.class:0:0:0:0 | TestKt<RawFieldUsedKt> | Test.kt:5:3:5:18 | getRawField |
|
|
| file:///!unknown-binary-location/TestKt.class:0:0:0:0 | TestKt<RawFieldUsedKt> | Test.kt:5:3:5:18 | setRawField |
|
|
| file:///!unknown-binary-location/TestKt.class:0:0:0:0 | TestKt<RawFieldUsedKt> | file:///!unknown-binary-location/TestKt.class:0:0:0:0 | TestKt<RawFieldUsedKt> |
|
|
| file:///!unknown-binary-location/TestKt.class:0:0:0:0 | TestKt<RawFieldUsedKt> | file:///!unknown-binary-location/TestKt.class:0:0:0:0 | method |
|