KtLightMemberModifierList:hasExplicitModifier("default") returns false

#KT-18070 Fixed
This commit is contained in:
Pavel V. Talanov
2017-05-25 15:44:35 +03:00
parent f54267eab4
commit f3f2379e5a
2 changed files with 14 additions and 0 deletions
@@ -79,6 +79,7 @@ private class KtLightMemberModifierList(
) : KtLightModifierList<KtLightMember<*>>(owner) {
override fun hasModifierProperty(name: String) = when {
name == PsiModifier.ABSTRACT && isImplementationInInterface() -> false
// pretend this method behaves like a default method
name == PsiModifier.DEFAULT && isImplementationInInterface() -> true
dummyDelegate != null -> {
when {
@@ -90,6 +91,10 @@ private class KtLightMemberModifierList(
else -> clsDelegate.hasModifierProperty(name)
}
override fun hasExplicitModifier(name: String) =
// kotlin methods can't be truly default atm, that way we can avoid being reported on by diagnostics, namely android lint
if (name == PsiModifier.DEFAULT) false else super.hasExplicitModifier(name)
private fun isMethodOverride() = owner is KtLightMethod && owner.kotlinOrigin?.hasModifier(KtTokens.OVERRIDE_KEYWORD) ?: false
private fun isImplementationInInterface()