Skip to content

Commit

Permalink
check functional interface for modifiers
Browse files Browse the repository at this point in the history
  • Loading branch information
neetopia committed May 7, 2024
1 parent 4aef6e1 commit aa11a68
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
Expand Up @@ -211,6 +211,9 @@ internal fun KtClassOrObjectSymbol.toModifiers(): Set<Modifier> {
if (visibility != JavaVisibilities.PackageVisibility) {
result.add(visibility.toModifier())
}
if (isFun) {
result.add(Modifier.FUN)
}
if (isInline) {
result.add(Modifier.INLINE)
}
Expand Down
Expand Up @@ -34,7 +34,7 @@ class JavaModifierProcessor : AbstractTestProcessor() {
override fun process(resolver: Resolver): List<KSAnnotated> {
listOf("ALib", "ASrc").forEach { clsName ->
resolver.getClassDeclarationByName(clsName)!!.let { cls ->
println(cls.modifiers.contains(Modifier.FUN))
assert(cls.modifiers.contains(Modifier.FUN))
}
}

Expand Down
8 changes: 8 additions & 0 deletions test-utils/testData/api/javaModifiers.kt
Expand Up @@ -102,6 +102,10 @@
// OuterKotlinClass: OPEN : PUBLIC
// END
// MODULE: module1
// FILE: ALib.kt
fun interface ALib {
fun test(): Boolean
}
// FILE: DependencyOuterJavaClass.java
public class DependencyOuterJavaClass {
public class DependencyInnerJavaClass {}
Expand Down Expand Up @@ -152,6 +156,10 @@ open class DependencyOuterKotlinClass {
fun synchronizedFun(): String = ""
}
// MODULE: main(module1)
// FILE: ASrc.kt
fun interface ASrc {
fun test(): Boolean
}
// FILE: a.kt
annotation class Test

Expand Down

0 comments on commit aa11a68

Please sign in to comment.