FIR IDE: Add explicit assertion that module info is ModuleSourceInfo

This commit is contained in:
Roman Golyshev
2021-05-18 16:49:11 +03:00
committed by Space
parent 44f74888e0
commit ad34c19f9a
@@ -85,6 +85,10 @@ internal class FirModuleResolveStateImpl(
* [ktDeclaration] should be either [KtDeclaration] or [KtLambdaExpression]
*/
private fun findSourceFirDeclarationByExpression(ktDeclaration: KtExpression): FirDeclaration {
require(ktDeclaration.getModuleInfo() is ModuleSourceInfo) {
"Declaration should have ModuleSourceInfo, instead it had ${ktDeclaration.getModuleInfo()}"
}
val nonLocalNamedDeclaration = ktDeclaration.getNonLocalContainingOrThisDeclaration()
?: error("Declaration should have non-local container${ktDeclaration.getElementTextInContext()}")