Logging with implicit property getter doesn't include the file or line number
Open
- Dominant language
- Kotlin
- Stars
- 3.5k
- Forks
- 415
- Avg merge
- 1d 2h
- Merged PRs (30d)
- 53
Description
We have some code that processes properties and potentially logs an error. The property is defined like this:
```kotlin
abstract class SomeClass {
@get:SomeAnnotation
abstract val stuff: List
}
```
We log an error like this:
```kotlin
fun KSPropertyGetter.logError() {
environment.logger.error("Example error, this)
}
```
In KSP1 this would correctly print:
```
Test.kt:3: Example error
```
but in KSP2 this prints
```
Example error
```
If I use `this.parent` (which uses the property declaration) it works as expected. I assume this is because there no explicit getter.
Contributor guide
Assessment
This issue has not been assessed yet.