FIR IDE: Add explicit assertion that module info is ModuleSourceInfo
This commit is contained in:
+4
@@ -85,6 +85,10 @@ internal class FirModuleResolveStateImpl(
|
|||||||
* [ktDeclaration] should be either [KtDeclaration] or [KtLambdaExpression]
|
* [ktDeclaration] should be either [KtDeclaration] or [KtLambdaExpression]
|
||||||
*/
|
*/
|
||||||
private fun findSourceFirDeclarationByExpression(ktDeclaration: KtExpression): FirDeclaration {
|
private fun findSourceFirDeclarationByExpression(ktDeclaration: KtExpression): FirDeclaration {
|
||||||
|
require(ktDeclaration.getModuleInfo() is ModuleSourceInfo) {
|
||||||
|
"Declaration should have ModuleSourceInfo, instead it had ${ktDeclaration.getModuleInfo()}"
|
||||||
|
}
|
||||||
|
|
||||||
val nonLocalNamedDeclaration = ktDeclaration.getNonLocalContainingOrThisDeclaration()
|
val nonLocalNamedDeclaration = ktDeclaration.getNonLocalContainingOrThisDeclaration()
|
||||||
?: error("Declaration should have non-local container${ktDeclaration.getElementTextInContext()}")
|
?: error("Declaration should have non-local container${ktDeclaration.getElementTextInContext()}")
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user