[K2] Make impl classes in SourceNavigator private to prevent

...accidental use of tree-specific implementation instead of common one.
Actually, I stepped on this rake myself in next commit, when
accidentally imported function from `PsiSourceNavigator`.

^KT-59978
This commit is contained in:
Roman Efremov
2023-10-10 15:03:10 +02:00
committed by Space Team
parent 8798fdeb82
commit db886a0435
@@ -57,7 +57,7 @@ interface SourceNavigator {
}
}
open class LightTreeSourceNavigator : SourceNavigator {
private open class LightTreeSourceNavigator : SourceNavigator {
private fun <T> FirElement.withSource(f: (KtSourceElement) -> T): T? =
source?.let { f(it) }
@@ -111,7 +111,7 @@ open class LightTreeSourceNavigator : SourceNavigator {
}
//by default psi tree can reuse light tree manipulations
object PsiSourceNavigator : LightTreeSourceNavigator() {
private object PsiSourceNavigator : LightTreeSourceNavigator() {
//Swallows incorrect casts!!!
private inline fun <reified P : PsiElement> FirElement.psi(): P? = source?.psi()