[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:
committed by
Space Team
parent
8798fdeb82
commit
db886a0435
+2
-2
@@ -57,7 +57,7 @@ interface SourceNavigator {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
open class LightTreeSourceNavigator : SourceNavigator {
|
private open class LightTreeSourceNavigator : SourceNavigator {
|
||||||
|
|
||||||
private fun <T> FirElement.withSource(f: (KtSourceElement) -> T): T? =
|
private fun <T> FirElement.withSource(f: (KtSourceElement) -> T): T? =
|
||||||
source?.let { f(it) }
|
source?.let { f(it) }
|
||||||
@@ -111,7 +111,7 @@ open class LightTreeSourceNavigator : SourceNavigator {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//by default psi tree can reuse light tree manipulations
|
//by default psi tree can reuse light tree manipulations
|
||||||
object PsiSourceNavigator : LightTreeSourceNavigator() {
|
private object PsiSourceNavigator : LightTreeSourceNavigator() {
|
||||||
|
|
||||||
//Swallows incorrect casts!!!
|
//Swallows incorrect casts!!!
|
||||||
private inline fun <reified P : PsiElement> FirElement.psi(): P? = source?.psi()
|
private inline fun <reified P : PsiElement> FirElement.psi(): P? = source?.psi()
|
||||||
|
|||||||
Reference in New Issue
Block a user