From 9e55da7eb92b5a4ce78257f1397134738d4de97c Mon Sep 17 00:00:00 2001 From: Eldar Abusalimov Date: Tue, 20 Oct 2020 19:35:39 +0300 Subject: [PATCH] ComponentStoreWithExtraComponents: Workaround for Kotlin compiler bug KT-42831 CCE when a method returning generic type is called from annotated if statement Fixes the following exception: - java.lang.ClassCastException: class java.util.ArrayList cannot be cast to class kotlin.Unit GitOrigin-RevId: 7aa254a1d9439af37ece9fbc76ecb85b895e7e27 --- .../src/ComponentStoreWithExtraComponents.kt | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/platform/configuration-store-impl/src/ComponentStoreWithExtraComponents.kt b/platform/configuration-store-impl/src/ComponentStoreWithExtraComponents.kt index 815c5111fac5..6eb656513554 100644 --- a/platform/configuration-store-impl/src/ComponentStoreWithExtraComponents.kt +++ b/platform/configuration-store-impl/src/ComponentStoreWithExtraComponents.kt @@ -38,8 +38,7 @@ abstract class ComponentStoreWithExtraComponents : ComponentStoreImpl() { } final override fun initComponent(component: Any, serviceDescriptor: ServiceDescriptor?, pluginId: PluginId?) { - @Suppress("DEPRECATION") - if (component is com.intellij.openapi.components.SettingsSavingComponent) { + if (component is @Suppress("DEPRECATION") com.intellij.openapi.components.SettingsSavingComponent) { settingsSavingComponents.add(component) } else if (component is SettingsSavingComponent) {