[AA K2] add missing resolve for signature creation
^KT-54311
This commit is contained in:
committed by
Space Team
parent
202a022b49
commit
638eccac16
+5
-2
@@ -9,6 +9,7 @@ import org.jetbrains.kotlin.analysis.api.fir.KtFirAnalysisSession
|
|||||||
import org.jetbrains.kotlin.analysis.low.level.api.fir.ideSessionComponents
|
import org.jetbrains.kotlin.analysis.low.level.api.fir.ideSessionComponents
|
||||||
import org.jetbrains.kotlin.fir.FirSession
|
import org.jetbrains.kotlin.fir.FirSession
|
||||||
import org.jetbrains.kotlin.fir.declarations.FirDeclaration
|
import org.jetbrains.kotlin.fir.declarations.FirDeclaration
|
||||||
|
import org.jetbrains.kotlin.fir.declarations.FirResolvePhase
|
||||||
import org.jetbrains.kotlin.fir.renderWithType
|
import org.jetbrains.kotlin.fir.renderWithType
|
||||||
import org.jetbrains.kotlin.fir.resolve.providers.symbolProvider
|
import org.jetbrains.kotlin.fir.resolve.providers.symbolProvider
|
||||||
import org.jetbrains.kotlin.fir.scopes.FirScope
|
import org.jetbrains.kotlin.fir.scopes.FirScope
|
||||||
@@ -16,6 +17,7 @@ import org.jetbrains.kotlin.fir.scopes.processClassifiersByName
|
|||||||
import org.jetbrains.kotlin.fir.symbols.FirBasedSymbol
|
import org.jetbrains.kotlin.fir.symbols.FirBasedSymbol
|
||||||
import org.jetbrains.kotlin.fir.symbols.impl.FirCallableSymbol
|
import org.jetbrains.kotlin.fir.symbols.impl.FirCallableSymbol
|
||||||
import org.jetbrains.kotlin.fir.symbols.impl.FirClassifierSymbol
|
import org.jetbrains.kotlin.fir.symbols.impl.FirClassifierSymbol
|
||||||
|
import org.jetbrains.kotlin.fir.symbols.lazyResolveToPhase
|
||||||
import org.jetbrains.kotlin.ir.util.IdSignature
|
import org.jetbrains.kotlin.ir.util.IdSignature
|
||||||
import org.jetbrains.kotlin.name.ClassId
|
import org.jetbrains.kotlin.name.ClassId
|
||||||
import org.jetbrains.kotlin.name.Name
|
import org.jetbrains.kotlin.name.Name
|
||||||
@@ -59,13 +61,14 @@ internal inline fun <reified D : FirDeclaration> Collection<FirCallableSymbol<*>
|
|||||||
return declaration
|
return declaration
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
|
|
||||||
internal fun FirBasedSymbol<*>.createSignature(): IdSignature =
|
internal fun FirBasedSymbol<*>.createSignature(): IdSignature = fir.createSignature()
|
||||||
fir.createSignature()
|
|
||||||
|
|
||||||
internal fun FirDeclaration.createSignature(): IdSignature {
|
internal fun FirDeclaration.createSignature(): IdSignature {
|
||||||
|
lazyResolveToPhase(FirResolvePhase.IMPLICIT_TYPES_BODY_RESOLVE)
|
||||||
val signatureComposer = moduleData.session.ideSessionComponents.signatureComposer
|
val signatureComposer = moduleData.session.ideSessionComponents.signatureComposer
|
||||||
return signatureComposer.composeSignature(this, allowLocalClasses = true)
|
return signatureComposer.composeSignature(this, allowLocalClasses = true)
|
||||||
?: error("Could not compose signature for ${this.renderWithType()}, looks like it is private or local")
|
?: error("Could not compose signature for ${this.renderWithType()}, looks like it is private or local")
|
||||||
|
|||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
// DO_NOT_CHECK_NON_PSI_SYMBOL_RESTORE
|
// DO_NOT_CHECK_NON_PSI_SYMBOL_RESTORE_K1
|
||||||
annotation class ReceiverAnnotation
|
annotation class ReceiverAnnotation
|
||||||
@Target(AnnotationTarget.TYPE)
|
@Target(AnnotationTarget.TYPE)
|
||||||
annotation class ReceiverTypeAnnotation
|
annotation class ReceiverTypeAnnotation
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// DO_NOT_CHECK_NON_PSI_SYMBOL_RESTORE
|
// DO_NOT_CHECK_NON_PSI_SYMBOL_RESTORE_K1
|
||||||
class A {
|
class A {
|
||||||
val a: Int = 10
|
val a: Int = 10
|
||||||
fun x() = 10
|
fun x() = 10
|
||||||
|
|||||||
Vendored
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
// DO_NOT_CHECK_NON_PSI_SYMBOL_RESTORE
|
// DO_NOT_CHECK_NON_PSI_SYMBOL_RESTORE_K1
|
||||||
context(kotlin.Int, s@kotlin.String)
|
context(kotlin.Int, s@kotlin.String)
|
||||||
class A {
|
class A {
|
||||||
constructor(int: Int) {}
|
constructor(int: Int) {}
|
||||||
|
|||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
// DO_NOT_CHECK_NON_PSI_SYMBOL_RESTORE
|
// DO_NOT_CHECK_NON_PSI_SYMBOL_RESTORE_K1
|
||||||
class A {
|
class A {
|
||||||
constructor(i: Int)
|
constructor(i: Int)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// DO_NOT_CHECK_NON_PSI_SYMBOL_RESTORE
|
// DO_NOT_CHECK_NON_PSI_SYMBOL_RESTORE_K1
|
||||||
val x: Int = 10
|
val x: Int = 10
|
||||||
val Int.y get() = this
|
val Int.y get() = this
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user