AA: do not create symbol pointers for (intersection|substitution) overridden members
This commit is contained in:
committed by
Ilya Kirillov
parent
e50da634bc
commit
efb867b46c
+7
-4
@@ -37,12 +37,15 @@ public class KtPsiBasedSymbolPointer<S : KtSymbol>(private val psiPointer: Smart
|
||||
public fun <S : KtSymbol> createForSymbolFromSource(symbol: S): KtPsiBasedSymbolPointer<S>? {
|
||||
if (symbol.origin == KtSymbolOrigin.LIBRARY) return null
|
||||
|
||||
/**
|
||||
* If symbol points to a generated member, we won't be able to recover it later on, because there is no corresponding
|
||||
* psi by which it can be found
|
||||
*/
|
||||
// If symbol points to a generated member, we won't be able to recover it later on, because there is no corresponding
|
||||
// psi by which it can be found
|
||||
if (symbol.origin == KtSymbolOrigin.SOURCE_MEMBER_GENERATED) return null
|
||||
|
||||
// (intersection | substitution) overrides are intermediate, non-materialized (i.e., fake) members, coming from super type(s).
|
||||
// Therefore, no corresponding psi either.
|
||||
if (symbol.origin == KtSymbolOrigin.INTERSECTION_OVERRIDE) return null
|
||||
if (symbol.origin == KtSymbolOrigin.SUBSTITUTION_OVERRIDE) return null
|
||||
|
||||
val psi = when (val psi = symbol.psi) {
|
||||
is KtDeclaration -> psi
|
||||
is KtFile -> psi
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
// WITH_STDLIB
|
||||
// DO_NOT_CHECK_SYMBOL_RESTORE
|
||||
|
||||
// class: kotlin/Int
|
||||
|
||||
@@ -7,4 +7,3 @@ enum class E {
|
||||
}
|
||||
|
||||
// callable: test/E.A
|
||||
// DO_NOT_CHECK_SYMBOL_RESTORE
|
||||
|
||||
@@ -1,3 +1 @@
|
||||
// DO_NOT_CHECK_SYMBOL_RESTORE
|
||||
|
||||
// class: java/lang/String
|
||||
|
||||
Reference in New Issue
Block a user