FIR IDE: Resolve declaration in withFirDeclaration only if needed
This commit is contained in:
+8
-2
@@ -45,8 +45,14 @@ inline fun <R> KtDeclaration.withFirDeclaration(
|
||||
action: (FirDeclaration) -> R
|
||||
): R {
|
||||
val firDeclaration = resolveState.findSourceFirDeclaration(this)
|
||||
firDeclaration.resolvedFirToPhase(phase, resolveState)
|
||||
return action(firDeclaration)
|
||||
|
||||
val resolvedDeclaration = if (firDeclaration.resolvePhase < phase) {
|
||||
firDeclaration.resolvedFirToPhase(phase, resolveState)
|
||||
} else {
|
||||
firDeclaration
|
||||
}
|
||||
|
||||
return action(resolvedDeclaration)
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user