[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. * 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 getName(): String = _name ?: ""
override fun isConstructor(): Boolean = true override fun isConstructor(): Boolean = true
override fun isOverride(): Boolean = false
override fun hasTypeParameters(): Boolean = false override fun hasTypeParameters(): Boolean = false
override fun getTypeParameterList(): PsiTypeParameterList? = null 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. * 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 isValid(): Boolean = super.isValid() && functionDeclaration?.isValid ?: functionSymbolPointer.isValid(ktModule)
override fun isOverride(): Boolean = withFunctionSymbol { it.getDirectlyOverriddenSymbols().isNotEmpty() }
override fun equals(other: Any?): Boolean { override fun equals(other: Any?): Boolean {
if (this === other) return true if (this === other) return true
if (other !is SymbolLightMethod<*> || if (other !is SymbolLightMethod<*> ||
@@ -167,6 +167,12 @@ internal class SymbolLightSimpleMethod(
override fun isConstructor(): Boolean = false 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 KtType.isVoidType: Boolean get() = isUnit && nullabilityType != NullabilityType.Nullable
private val _returnedType: PsiType by lazyPub { private val _returnedType: PsiType by lazyPub {
@@ -34,12 +34,14 @@ public final class Container /* p1.Container*/ {
@java.lang.Override() @java.lang.Override()
public char get(int);// get(int) public char get(int);// get(int)
public MyString();// .ctor() @java.lang.Override()
public error.NonExistentClass chars();// chars() public error.NonExistentClass chars();// chars()
@java.lang.Override()
public error.NonExistentClass codePoints();// codePoints() public error.NonExistentClass codePoints();// codePoints()
public MyString();// .ctor()
public int getLength();// getLength() public int getLength();// getLength()
} }
} }
@@ -1,7 +1,8 @@
public final class C /* p.C*/ { public final class C /* p.C*/ {
public C();// .ctor() @java.lang.Override()
public int af();// af() public int af();// af()
public C();// .ctor()
public int getAp();// getAp() public int getAp();// getAp()
} }
@@ -1,10 +1,11 @@
public final class C /* p.C*/ { public final class C /* p.C*/ {
private final int ip = 5 /* initializer type: int */; private final int ip = 5 /* initializer type: int */;
public C();// .ctor() @java.lang.Override()
public int af();// af() public int af();// af()
public C();// .ctor()
public int getAp();// getAp() public int getAp();// getAp()
public int getIp();// getIp() public int getIp();// getIp()
@@ -1,7 +1,8 @@
public final class C /* p.C*/ { public final class C /* p.C*/ {
public C();// .ctor() @java.lang.Override()
public int af();// af() public int af();// af()
public C();// .ctor()
public int getAp();// getAp() public int getAp();// getAp()
} }
@@ -10,9 +10,10 @@ public final class MyList /* MyList*/ implements java.util.List<java.lang.String
} }
public abstract class MySet /* MySet*/<T> implements ASet<T> { public abstract class MySet /* MySet*/<T> implements ASet<T> {
public MySet();// .ctor() @java.lang.Override()
public boolean remove(@org.jetbrains.annotations.NotNull() java.lang.String);// remove(java.lang.String) public boolean remove(@org.jetbrains.annotations.NotNull() java.lang.String);// remove(java.lang.String)
public MySet();// .ctor()
} }
public abstract class SmartSet /* SmartSet*/<T> extends kotlin.collections.AbstractMutableSet<T> { public abstract class SmartSet /* SmartSet*/<T> extends kotlin.collections.AbstractMutableSet<T> {
@@ -9,11 +9,12 @@ public enum Foo /* Foo*/ {
public final class InlineInheritance /* InlineInheritance*/ { public final class InlineInheritance /* InlineInheritance*/ {
private final int v; private final int v;
@java.lang.Override()
public int y();// y()
public final int getV();// getV() public final int getV();// getV()
public int getX();// getX() public int getX();// getX()
public int y();// y()
} }
public final class InlinedDelegate /* InlinedDelegate*/<T> { public final class InlinedDelegate /* InlinedDelegate*/<T> {