[SLC] SymbolLightMethod: avoid resolve to calculate isOverride

This commit is contained in:
Dmitrii Gridin
2023-01-04 21:32:30 +01:00
committed by Space Team
parent 6cea761b6e
commit 2dfa4d37ea
9 changed files with 28 additions and 16 deletions
@@ -1,5 +1,5 @@
/*
* Copyright 2010-2022 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Copyright 2010-2023 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
@@ -37,6 +37,7 @@ internal class SymbolLightConstructor(
override fun getName(): String = _name ?: ""
override fun isConstructor(): Boolean = true
override fun isOverride(): Boolean = false
override fun hasTypeParameters(): Boolean = false
override fun getTypeParameterList(): PsiTypeParameterList? = null
@@ -1,5 +1,5 @@
/*
* Copyright 2010-2022 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Copyright 2010-2023 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
@@ -135,8 +135,6 @@ internal abstract class SymbolLightMethod<FType : KtFunctionLikeSymbol> private
override fun isValid(): Boolean = super.isValid() && functionDeclaration?.isValid ?: functionSymbolPointer.isValid(ktModule)
override fun isOverride(): Boolean = withFunctionSymbol { it.getDirectlyOverriddenSymbols().isNotEmpty() }
override fun equals(other: Any?): Boolean {
if (this === other) return true
if (other !is SymbolLightMethod<*> ||
@@ -167,6 +167,12 @@ internal class SymbolLightSimpleMethod(
override fun isConstructor(): Boolean = false
override fun isOverride(): Boolean = _isOverride
private val _isOverride: Boolean by lazyPub {
withFunctionSymbol { it.isOverride }
}
private val KtType.isVoidType: Boolean get() = isUnit && nullabilityType != NullabilityType.Nullable
private val _returnedType: PsiType by lazyPub {