File tree 3 files changed +15
-1
lines changed
kotlin-analysis-api/src/main/kotlin/com/google/devtools/ksp/impl/symbol/kotlin
src/main/kotlin/com/google/devtools/ksp/processor
3 files changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -231,7 +231,7 @@ internal inline fun <R> analyze(crossinline action: KtAnalysisSession.() -> R):
231
231
internal fun KtSymbolWithMembers.declarations (): Sequence <KSDeclaration > {
232
232
return analyze {
233
233
this @declarations.let {
234
- it.getDeclaredMemberScope().getAllSymbols() + it.getStaticMemberScope ().getAllSymbols()
234
+ it.getDeclaredMemberScope().getAllSymbols() + it.getStaticDeclaredMemberScope ().getAllSymbols()
235
235
}.distinct().map { symbol ->
236
236
when (symbol) {
237
237
is KtNamedClassOrObjectSymbol -> KSClassDeclarationImpl .getCached(symbol)
Original file line number Diff line number Diff line change @@ -19,6 +19,7 @@ package com.google.devtools.ksp.processor
19
19
20
20
import com.google.devtools.ksp.getClassDeclarationByName
21
21
import com.google.devtools.ksp.getDeclaredFunctions
22
+ import com.google.devtools.ksp.getDeclaredProperties
22
23
import com.google.devtools.ksp.isAbstract
23
24
import com.google.devtools.ksp.processing.Resolver
24
25
import com.google.devtools.ksp.symbol.KSAnnotated
@@ -100,6 +101,9 @@ class DefaultFunctionProcessor : AbstractTestProcessor() {
100
101
result.add(" ${aProperty.simpleName.asString()} : ${aProperty.isAbstract()} " )
101
102
val D = resolver.getClassDeclarationByName(" D" )!!
102
103
D .getAllProperties().forEach { result.add(" ${it.simpleName.asString()} : isMutable: ${it.isMutable} " ) }
104
+ resolver.getClassDeclarationByName(" JavaDerived" )!! .getDeclaredProperties().forEach {
105
+ result.add(it.toString())
106
+ }
103
107
return emptyList()
104
108
}
105
109
Original file line number Diff line number Diff line change @@ -76,3 +76,13 @@ class D {
76
76
77
77
final int finalField;
78
78
}
79
+
80
+ // FILE: JavaBase.java
81
+
82
+ class JavaBase {
83
+ static String staticField;
84
+ }
85
+
86
+ // FILE: JavaDerived.java
87
+ class JavaDerived extends JavaBase {
88
+ }
You can’t perform that action at this time.
0 commit comments