[FIR IDE] Add check resolved type for phase less than Types
This commit is contained in:
+1
@@ -62,6 +62,7 @@ private class FirIdeDesignatedBodyResolveTransformerForReturnTypeCalculatorImpl(
|
||||
|
||||
private inline fun <D : FirCallableDeclaration> D.processCallable(body: (FirDeclarationDesignation) -> Unit) {
|
||||
if (this !== targetDeclaration) return
|
||||
if (resolvePhase < FirResolvePhase.TYPES && returnTypeRef is FirResolvedTypeRef) return
|
||||
ensureResolved(FirResolvePhase.TYPES)
|
||||
if (returnTypeRef is FirImplicitTypeRef) {
|
||||
val declarationList = designation.filterIsInstance<FirDeclaration>()
|
||||
|
||||
+2
@@ -16,6 +16,7 @@ import org.jetbrains.kotlin.fir.resolve.transformers.body.resolve.FirDesignatedB
|
||||
import org.jetbrains.kotlin.fir.resolve.transformers.body.resolve.ImplicitBodyResolveComputationSession
|
||||
import org.jetbrains.kotlin.fir.symbols.ensureResolved
|
||||
import org.jetbrains.kotlin.fir.types.FirImplicitTypeRef
|
||||
import org.jetbrains.kotlin.fir.types.FirResolvedTypeRef
|
||||
|
||||
fun FirIdeEnsureBasedTransformerForReturnTypeCalculator(
|
||||
designation: Iterator<FirElement>,
|
||||
@@ -60,6 +61,7 @@ private class FirIdeEnsureBasedTransformerForReturnTypeCalculatorImpl(
|
||||
|
||||
private fun <T : FirCallableDeclaration> T.ensureReturnType() {
|
||||
if (this !== targetDeclaration) return
|
||||
if (resolvePhase < FirResolvePhase.TYPES && returnTypeRef is FirResolvedTypeRef) return
|
||||
ensureResolved(FirResolvePhase.TYPES)
|
||||
if (returnTypeRef is FirImplicitTypeRef) {
|
||||
ensureResolved(FirResolvePhase.IMPLICIT_TYPES_BODY_RESOLVE)
|
||||
|
||||
+1
@@ -43,6 +43,7 @@ internal fun FirLazyDeclarationResolver.lazyResolveDeclaration(
|
||||
}
|
||||
|
||||
if (firDeclaration.resolvePhase < FirResolvePhase.TYPES) {
|
||||
if (firDeclaration.returnTypeRef is FirResolvedTypeRef) return
|
||||
lazyResolveDeclaration(
|
||||
firDeclarationToResolve = firDeclaration,
|
||||
moduleFileCache = moduleFileCache,
|
||||
|
||||
Reference in New Issue
Block a user