FIR IDE: fix fir declaration leak in symbols
This commit is contained in:
+2
-2
@@ -26,10 +26,10 @@ internal class KtFirAnonymousFunctionSymbol(
|
|||||||
private val builder: KtSymbolByFirBuilder
|
private val builder: KtSymbolByFirBuilder
|
||||||
) : KtAnonymousFunctionSymbol(), KtFirSymbol<FirAnonymousFunction> {
|
) : KtAnonymousFunctionSymbol(), KtFirSymbol<FirAnonymousFunction> {
|
||||||
override val firRef = firRef(fir, resolveState)
|
override val firRef = firRef(fir, resolveState)
|
||||||
override val psi: PsiElement? by firRef.withFirAndCache { it.findPsi(fir.session) }
|
override val psi: PsiElement? by firRef.withFirAndCache { fir -> fir.findPsi(fir.session) }
|
||||||
|
|
||||||
override val type: KtType by firRef.withFirAndCache(FirResolvePhase.IMPLICIT_TYPES_BODY_RESOLVE) { builder.buildKtType(it.returnTypeRef) }
|
override val type: KtType by firRef.withFirAndCache(FirResolvePhase.IMPLICIT_TYPES_BODY_RESOLVE) { builder.buildKtType(it.returnTypeRef) }
|
||||||
override val valueParameters: List<KtParameterSymbol> by firRef.withFirAndCache {
|
override val valueParameters: List<KtParameterSymbol> by firRef.withFirAndCache { fir ->
|
||||||
fir.valueParameters.map { valueParameter ->
|
fir.valueParameters.map { valueParameter ->
|
||||||
check(valueParameter is FirValueParameterImpl)
|
check(valueParameter is FirValueParameterImpl)
|
||||||
builder.buildParameterSymbol(valueParameter)
|
builder.buildParameterSymbol(valueParameter)
|
||||||
|
|||||||
+2
-2
@@ -34,7 +34,7 @@ internal class KtFirClassOrObjectSymbol(
|
|||||||
private val builder: KtSymbolByFirBuilder
|
private val builder: KtSymbolByFirBuilder
|
||||||
) : KtClassOrObjectSymbol(), KtFirSymbol<FirRegularClass> {
|
) : KtClassOrObjectSymbol(), KtFirSymbol<FirRegularClass> {
|
||||||
override val firRef = firRef(fir, resolveState)
|
override val firRef = firRef(fir, resolveState)
|
||||||
override val psi: PsiElement? by firRef.withFirAndCache { it.findPsi(fir.session) }
|
override val psi: PsiElement? by firRef.withFirAndCache { fir -> fir.findPsi(fir.session) }
|
||||||
override val name: Name get() = firRef.withFir { it.symbol.classId.shortClassName }
|
override val name: Name get() = firRef.withFir { it.symbol.classId.shortClassName }
|
||||||
override val classIdIfNonLocal: ClassId?
|
override val classIdIfNonLocal: ClassId?
|
||||||
get() = firRef.withFir { fir ->
|
get() = firRef.withFir { fir ->
|
||||||
@@ -64,7 +64,7 @@ internal class KtFirClassOrObjectSymbol(
|
|||||||
fir.getPrimaryConstructorIfAny()?.let { builder.buildConstructorSymbol(it) }
|
fir.getPrimaryConstructorIfAny()?.let { builder.buildConstructorSymbol(it) }
|
||||||
}
|
}
|
||||||
|
|
||||||
override val typeParameters by firRef.withFirAndCache {
|
override val typeParameters by firRef.withFirAndCache { fir ->
|
||||||
fir.typeParameters.map { typeParameter ->
|
fir.typeParameters.map { typeParameter ->
|
||||||
builder.buildTypeParameterSymbol(typeParameter.symbol.fir)
|
builder.buildTypeParameterSymbol(typeParameter.symbol.fir)
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -37,7 +37,7 @@ internal class KtFirConstructorSymbol(
|
|||||||
private val builder: KtSymbolByFirBuilder
|
private val builder: KtSymbolByFirBuilder
|
||||||
) : KtConstructorSymbol(), KtFirSymbol<FirConstructor> {
|
) : KtConstructorSymbol(), KtFirSymbol<FirConstructor> {
|
||||||
override val firRef = firRef(fir, resolveState)
|
override val firRef = firRef(fir, resolveState)
|
||||||
override val psi: PsiElement? by firRef.withFirAndCache { it.findPsi(fir.session) }
|
override val psi: PsiElement? by firRef.withFirAndCache { fir -> fir.findPsi(fir.session) }
|
||||||
|
|
||||||
override val type: KtType by firRef.withFirAndCache(FirResolvePhase.IMPLICIT_TYPES_BODY_RESOLVE) { builder.buildKtType(it.returnTypeRef) }
|
override val type: KtType by firRef.withFirAndCache(FirResolvePhase.IMPLICIT_TYPES_BODY_RESOLVE) { builder.buildKtType(it.returnTypeRef) }
|
||||||
override val valueParameters: List<KtConstructorParameterSymbol> by firRef.withFirAndCache { fir ->
|
override val valueParameters: List<KtConstructorParameterSymbol> by firRef.withFirAndCache { fir ->
|
||||||
|
|||||||
+1
-1
@@ -29,7 +29,7 @@ internal class KtFirConstructorValueParameterSymbol(
|
|||||||
private val builder: KtSymbolByFirBuilder
|
private val builder: KtSymbolByFirBuilder
|
||||||
) : KtConstructorParameterSymbol(), KtFirSymbol<FirValueParameter> {
|
) : KtConstructorParameterSymbol(), KtFirSymbol<FirValueParameter> {
|
||||||
override val firRef = firRef(fir, resolveState)
|
override val firRef = firRef(fir, resolveState)
|
||||||
override val psi: PsiElement? by firRef.withFirAndCache { it.findPsi(fir.session) }
|
override val psi: PsiElement? by firRef.withFirAndCache { fir -> fir.findPsi(fir.session) }
|
||||||
|
|
||||||
override val name: Name get() = firRef.withFir { it.name }
|
override val name: Name get() = firRef.withFir { it.name }
|
||||||
override val type: KtType by firRef.withFirAndCache(FirResolvePhase.TYPES) { builder.buildKtType(it.returnTypeRef) }
|
override val type: KtType by firRef.withFirAndCache(FirResolvePhase.TYPES) { builder.buildKtType(it.returnTypeRef) }
|
||||||
|
|||||||
+1
-1
@@ -30,7 +30,7 @@ internal class KtFirEnumEntrySymbol(
|
|||||||
private val builder: KtSymbolByFirBuilder
|
private val builder: KtSymbolByFirBuilder
|
||||||
) : KtEnumEntrySymbol(), KtFirSymbol<FirEnumEntry> {
|
) : KtEnumEntrySymbol(), KtFirSymbol<FirEnumEntry> {
|
||||||
override val firRef = firRef(fir, resolveState)
|
override val firRef = firRef(fir, resolveState)
|
||||||
override val psi: PsiElement? by firRef.withFirAndCache { it.findPsi(fir.session) }
|
override val psi: PsiElement? by firRef.withFirAndCache { fir -> fir.findPsi(fir.session) }
|
||||||
|
|
||||||
override val name: Name get() = firRef.withFir { it.name }
|
override val name: Name get() = firRef.withFir { it.name }
|
||||||
override val type: KtType by firRef.withFirAndCache(FirResolvePhase.IMPLICIT_TYPES_BODY_RESOLVE) { fir -> builder.buildKtType(fir.returnTypeRef) }
|
override val type: KtType by firRef.withFirAndCache(FirResolvePhase.IMPLICIT_TYPES_BODY_RESOLVE) { fir -> builder.buildKtType(fir.returnTypeRef) }
|
||||||
|
|||||||
+1
-1
@@ -36,7 +36,7 @@ internal class KtFirFunctionSymbol(
|
|||||||
private val builder: KtSymbolByFirBuilder
|
private val builder: KtSymbolByFirBuilder
|
||||||
) : KtFunctionSymbol(), KtFirSymbol<FirSimpleFunction> {
|
) : KtFunctionSymbol(), KtFirSymbol<FirSimpleFunction> {
|
||||||
override val firRef = firRef(fir, resolveState)
|
override val firRef = firRef(fir, resolveState)
|
||||||
override val psi: PsiElement? by firRef.withFirAndCache { it.findPsi(fir.session) }
|
override val psi: PsiElement? by firRef.withFirAndCache { fir -> fir.findPsi(fir.session) }
|
||||||
override val name: Name get() = firRef.withFir { it.name }
|
override val name: Name get() = firRef.withFir { it.name }
|
||||||
override val type: KtType by firRef.withFirAndCache(FirResolvePhase.IMPLICIT_TYPES_BODY_RESOLVE) { fir -> builder.buildKtType(fir.returnTypeRef) }
|
override val type: KtType by firRef.withFirAndCache(FirResolvePhase.IMPLICIT_TYPES_BODY_RESOLVE) { fir -> builder.buildKtType(fir.returnTypeRef) }
|
||||||
override val valueParameters: List<KtFirFunctionValueParameterSymbol> by firRef.withFirAndCache { fir ->
|
override val valueParameters: List<KtFirFunctionValueParameterSymbol> by firRef.withFirAndCache { fir ->
|
||||||
|
|||||||
+1
-1
@@ -28,7 +28,7 @@ internal class KtFirFunctionValueParameterSymbol(
|
|||||||
private val builder: KtSymbolByFirBuilder
|
private val builder: KtSymbolByFirBuilder
|
||||||
) : KtFunctionParameterSymbol(), KtFirSymbol<FirValueParameter> {
|
) : KtFunctionParameterSymbol(), KtFirSymbol<FirValueParameter> {
|
||||||
override val firRef = firRef(fir, resolveState)
|
override val firRef = firRef(fir, resolveState)
|
||||||
override val psi: PsiElement? by firRef.withFirAndCache { it.findPsi(fir.session) }
|
override val psi: PsiElement? by firRef.withFirAndCache { fir -> fir.findPsi(fir.session) }
|
||||||
|
|
||||||
override val name: Name get() = firRef.withFir { it.name }
|
override val name: Name get() = firRef.withFir { it.name }
|
||||||
override val isVararg: Boolean get() = firRef.withFir { it.isVararg }
|
override val isVararg: Boolean get() = firRef.withFir { it.isVararg }
|
||||||
|
|||||||
+1
-1
@@ -28,7 +28,7 @@ internal class KtFirJavaFieldSymbol(
|
|||||||
private val builder: KtSymbolByFirBuilder
|
private val builder: KtSymbolByFirBuilder
|
||||||
) : KtJavaFieldSymbol(), KtFirSymbol<FirField> {
|
) : KtJavaFieldSymbol(), KtFirSymbol<FirField> {
|
||||||
override val firRef = firRef(fir, resolveState)
|
override val firRef = firRef(fir, resolveState)
|
||||||
override val psi: PsiElement? by firRef.withFirAndCache { it.findPsi(fir.session) }
|
override val psi: PsiElement? by firRef.withFirAndCache { fir -> fir.findPsi(fir.session) }
|
||||||
|
|
||||||
override val type: KtType by firRef.withFirAndCache(FirResolvePhase.TYPES) { fir -> builder.buildKtType(fir.returnTypeRef) }
|
override val type: KtType by firRef.withFirAndCache(FirResolvePhase.TYPES) { fir -> builder.buildKtType(fir.returnTypeRef) }
|
||||||
override val isVal: Boolean get() = firRef.withFir { it.isVal }
|
override val isVal: Boolean get() = firRef.withFir { it.isVal }
|
||||||
|
|||||||
+1
-1
@@ -34,7 +34,7 @@ internal class KtFirLocalVariableSymbol(
|
|||||||
}
|
}
|
||||||
|
|
||||||
override val firRef = firRef(fir, resolveState)
|
override val firRef = firRef(fir, resolveState)
|
||||||
override val psi: PsiElement? by cached { fir.findPsi(fir.session) }
|
override val psi: PsiElement? by firRef.withFirAndCache { fir -> fir.findPsi(fir.session) }
|
||||||
|
|
||||||
override val isVal: Boolean get() = firRef.withFir { it.isVal }
|
override val isVal: Boolean get() = firRef.withFir { it.isVal }
|
||||||
override val name: Name get() = firRef.withFir { it.name }
|
override val name: Name get() = firRef.withFir { it.name }
|
||||||
|
|||||||
+1
-1
@@ -34,7 +34,7 @@ internal class KtFirPropertyGetterSymbol(
|
|||||||
}
|
}
|
||||||
|
|
||||||
override val firRef = firRef(fir, resolveState)
|
override val firRef = firRef(fir, resolveState)
|
||||||
override val psi: PsiElement? by firRef.withFirAndCache { it.findPsi(fir.session) }
|
override val psi: PsiElement? by firRef.withFirAndCache { fir -> fir.findPsi(fir.session) }
|
||||||
|
|
||||||
override val isDefault: Boolean get() = firRef.withFir { it is FirDefaultPropertyAccessor }
|
override val isDefault: Boolean get() = firRef.withFir { it is FirDefaultPropertyAccessor }
|
||||||
override val isInline: Boolean get() = firRef.withFir { it.isInline }
|
override val isInline: Boolean get() = firRef.withFir { it.isInline }
|
||||||
|
|||||||
+1
-1
@@ -34,7 +34,7 @@ internal class KtFirPropertySetterSymbol(
|
|||||||
}
|
}
|
||||||
|
|
||||||
override val firRef = firRef(fir, resolveState)
|
override val firRef = firRef(fir, resolveState)
|
||||||
override val psi: PsiElement? by firRef.withFirAndCache { it.findPsi(fir.session) }
|
override val psi: PsiElement? by firRef.withFirAndCache { fir -> fir.findPsi(fir.session) }
|
||||||
|
|
||||||
override val isDefault: Boolean get() = firRef.withFir { it is FirDefaultPropertyAccessor }
|
override val isDefault: Boolean get() = firRef.withFir { it is FirDefaultPropertyAccessor }
|
||||||
override val isInline: Boolean get() = firRef.withFir { it.isInline }
|
override val isInline: Boolean get() = firRef.withFir { it.isInline }
|
||||||
|
|||||||
+1
-1
@@ -41,7 +41,7 @@ internal class KtFirPropertySymbol(
|
|||||||
}
|
}
|
||||||
|
|
||||||
override val firRef = firRef(fir, resolveState)
|
override val firRef = firRef(fir, resolveState)
|
||||||
override val psi: PsiElement? by firRef.withFirAndCache { it.findPsi(fir.session) }
|
override val psi: PsiElement? by firRef.withFirAndCache { fir -> fir.findPsi(fir.session) }
|
||||||
|
|
||||||
override val isVal: Boolean get() = firRef.withFir { it.isVal }
|
override val isVal: Boolean get() = firRef.withFir { it.isVal }
|
||||||
override val name: Name get() = firRef.withFir { it.name }
|
override val name: Name get() = firRef.withFir { it.name }
|
||||||
|
|||||||
+1
-1
@@ -28,7 +28,7 @@ internal class KtFirSetterParameterSymbol(
|
|||||||
private val builder: KtSymbolByFirBuilder
|
private val builder: KtSymbolByFirBuilder
|
||||||
) : KtSetterParameterSymbol(), KtFirSymbol<FirValueParameter> {
|
) : KtSetterParameterSymbol(), KtFirSymbol<FirValueParameter> {
|
||||||
override val firRef = firRef(fir, resolveState)
|
override val firRef = firRef(fir, resolveState)
|
||||||
override val psi: PsiElement? by firRef.withFirAndCache { it.findPsi(fir.session) }
|
override val psi: PsiElement? by firRef.withFirAndCache { fir -> fir.findPsi(fir.session) }
|
||||||
|
|
||||||
override val name: Name get() = firRef.withFir { it.name }
|
override val name: Name get() = firRef.withFir { it.name }
|
||||||
override val type: KtType by firRef.withFirAndCache(FirResolvePhase.TYPES) { fir -> builder.buildKtType(fir.returnTypeRef) }
|
override val type: KtType by firRef.withFirAndCache(FirResolvePhase.TYPES) { fir -> builder.buildKtType(fir.returnTypeRef) }
|
||||||
|
|||||||
+1
-1
@@ -23,7 +23,7 @@ internal class KtFirTypeAliasSymbol(
|
|||||||
override val token: ValidityToken
|
override val token: ValidityToken
|
||||||
) : KtTypeAliasSymbol(), KtFirSymbol<FirTypeAlias> {
|
) : KtTypeAliasSymbol(), KtFirSymbol<FirTypeAlias> {
|
||||||
override val firRef = firRef(fir, resolveState)
|
override val firRef = firRef(fir, resolveState)
|
||||||
override val psi: PsiElement? by firRef.withFirAndCache { it.findPsi(fir.session) }
|
override val psi: PsiElement? by firRef.withFirAndCache { fir -> fir.findPsi(fir.session) }
|
||||||
override val name: Name get() = firRef.withFir { it.name }
|
override val name: Name get() = firRef.withFir { it.name }
|
||||||
override val classIdIfNonLocal: ClassId get() = firRef.withFir { it.symbol.classId }
|
override val classIdIfNonLocal: ClassId get() = firRef.withFir { it.symbol.classId }
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user