google / google/ksp

Missing type declaration annotations

Open
#2,445 3 comments 0 reactions 0 assignees View on GitHub
stale
Dominant language
Kotlin
Stars
3.5k
Forks
415
Avg merge
1d 2h
Merged PRs (30d)
53

Description

When you try to get annotation list of type declaration you get empty list instead of actual annotations.

My case of getting such behav:
```kotlin
(function.parameters.first().type.resolve().declaration as KSClassDeclaration).annotations
// [] - empty list
```
function that is mentioned is `exFun` in this example:
```kotlin
@MyAnn
fun interface Example {
suspend fun exFun(
param: Type?,
)
}
```

type itself:
```kotlin
@OtherAnn.NestedAnn
class Type(
tParam: Int,
)
```
expected to show `@OtherAnn.NestedAnn` as it's present

versions:
kotlin: 2.1.20 (not kmp, jvm proj if it matters)
ksp: 2.1.20-2.0.1

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.