Assertions to catch EA-114080

This commit is contained in:
Nicolay Mitropolsky
2018-02-22 12:50:09 +03:00
parent 5a591be25f
commit 3a609a9472
5 changed files with 24 additions and 5 deletions
@@ -62,7 +62,10 @@ data class PlatformAnalysisSettings(val platform: TargetPlatform, val sdk: Sdk?,
class KotlinCacheServiceImpl(val project: Project) : KotlinCacheService {
override fun getResolutionFacade(elements: List<KtElement>): ResolutionFacade {
return getFacadeToAnalyzeFiles(elements.map { it.containingKtFile })
return getFacadeToAnalyzeFiles(elements.map {
// in theory `containingKtFile` is `@NotNull` but in practice EA-114080
it.containingKtFile ?: throw IllegalStateException("containingKtFile was null for $it of ${it.javaClass}")
})
}
override fun getSuppressionCache(): KotlinSuppressCache = kotlinSuppressCache.value