[FIR] FirCallableSymbol: introduce calculateReturnType
It will help to avoid copy-pasted logic there it is needed ^KT-60728
This commit is contained in:
committed by
Space Team
parent
35b0cd65e9
commit
f549712912
@@ -13,22 +13,24 @@ import org.jetbrains.kotlin.fir.types.*
|
||||
import org.jetbrains.kotlin.mpp.CallableSymbolMarker
|
||||
import org.jetbrains.kotlin.name.CallableId
|
||||
import org.jetbrains.kotlin.name.Name
|
||||
import org.jetbrains.kotlin.util.OperatorNameConventions
|
||||
|
||||
abstract class FirCallableSymbol<D : FirCallableDeclaration> : FirBasedSymbol<D>(), CallableSymbolMarker {
|
||||
abstract val callableId: CallableId
|
||||
|
||||
val resolvedReturnTypeRef: FirResolvedTypeRef
|
||||
get() {
|
||||
ensureType(fir.returnTypeRef)
|
||||
val returnTypeRef = fir.returnTypeRef
|
||||
if (returnTypeRef !is FirResolvedTypeRef) {
|
||||
errorInLazyResolve("returnTypeRef", returnTypeRef::class, FirResolvedTypeRef::class)
|
||||
}
|
||||
|
||||
return returnTypeRef
|
||||
calculateReturnType()
|
||||
return fir.returnTypeRef as FirResolvedTypeRef
|
||||
}
|
||||
|
||||
fun calculateReturnType() {
|
||||
ensureType(fir.returnTypeRef)
|
||||
val returnTypeRef = fir.returnTypeRef
|
||||
if (returnTypeRef !is FirResolvedTypeRef) {
|
||||
errorInLazyResolve("returnTypeRef", returnTypeRef::class, FirResolvedTypeRef::class)
|
||||
}
|
||||
}
|
||||
|
||||
val resolvedReturnType: ConeKotlinType
|
||||
get() = resolvedReturnTypeRef.coneType
|
||||
|
||||
|
||||
Reference in New Issue
Block a user