Drop outdated KDoc and fix findSourceFirDeclarationByExpression signature
Review: https://jetbrains.team/p/kt/reviews/7690
Make findSourceFirDeclarationByExpression signature more specific.
`KtDeclaration` is an inheritor of `KtExpression`
`KtLambdaExpression` was changed to `KtFunctionLiteral` in
c24ad0ba51. I run analysis-api-fir tests
and ensured that `KtFunctionLiteral` appears in runtime instead of
`KtFunctionLiteral`
So `ktDeclaration` should be either `KtDeclaration` or
`KtFunctionLiteral`. But we don't need a KDoc for that because
`KtFunctionLiteral` is an inheritor of `KtDeclaration`, so type-system
already checks this invariant
This commit is contained in:
+2
-5
@@ -92,13 +92,10 @@ internal abstract class LLFirResolvableResolveSession(
|
||||
}
|
||||
|
||||
private fun findSourceFirSymbol(ktDeclaration: KtDeclaration, module: KtModule): FirBasedSymbol<*> {
|
||||
return findSourceFirDeclarationByExpression(ktDeclaration.originalDeclaration ?: ktDeclaration, module)
|
||||
return findSourceFirDeclarationByDeclaration(ktDeclaration.originalDeclaration ?: ktDeclaration, module)
|
||||
}
|
||||
|
||||
/**
|
||||
* [ktDeclaration] should be either [KtDeclaration] or [KtLambdaExpression]
|
||||
*/
|
||||
private fun findSourceFirDeclarationByExpression(ktDeclaration: KtExpression, module: KtModule): FirBasedSymbol<*> {
|
||||
private fun findSourceFirDeclarationByDeclaration(ktDeclaration: KtDeclaration, module: KtModule): FirBasedSymbol<*> {
|
||||
require(getModuleKind(module) == ModuleKind.RESOLVABLE_MODULE) {
|
||||
"Declaration should be resolvable module, instead it had ${module::class}"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user