[SLC] Fix modifiers for @JvmStatic methods in interfaces

This commit is contained in:
Pavel Mikhailovskii
2023-02-23 17:04:22 +00:00
committed by Space Team
parent 253cdb1b8f
commit 9204f8162e
5 changed files with 41 additions and 10 deletions
@@ -39,10 +39,10 @@ private class KtUltraLightMethodModifierList(
owner: KtUltraLightMethod,
val delegate: PsiMethod,
) : KtUltraLightModifierList<KtUltraLightMethod>(owner, support) {
override fun hasModifierProperty(name: String) = when {
override fun hasModifierProperty(name: String): Boolean = when {
name == PsiModifier.ABSTRACT && isImplementationInInterface() -> false
// pretend this method behaves like a default method
name == PsiModifier.DEFAULT && isImplementationInInterface() -> true
name == PsiModifier.DEFAULT && isImplementationInInterface() && !hasModifierProperty(PsiModifier.STATIC) -> true
name == PsiModifier.FINAL &&
(owner.containingClass.safeAs<KtLightClassForSourceDeclaration>()?.isPossiblyAffectedByAllOpen() == true)
-> delegate.hasModifierProperty(name)