After adding extension invoke on DeepRecursiveFunction in 1.4,
the compiler start reporting another error and now it doesn't write
info about callable descriptor. Therefore it's needed to use another
source of info for expression type
^KT-40926 Fixed
So far, quick-fix tests infrastructure neither supports the check
for multiple files (several .before/.after pairs) nor multi module
structure. Provided tests are quite limited yet allow to make sure that
the fix in question appears in expected context and get activated.
^KT-44043 fixed
- In kt10409 both 'pipe'-declarations contain error type.
NewKotlinTypeChecker in OverrideResolver considers error types as equal,
thus they are matched as bound declarations, thus 'IterablePipeline'
isn't considered to contain abstract member, thus no suggestion to add
abstract modifier.
Because initially test was covering purely technical issue of working
with error types, instead of removing it completely the additional
abstract member has been added
- in kt10808 we don't add explicit type anymore because
'noTypeInference' is false, because both expected type and actual type
are error-types, and KotlinIntroduceVariableHandler explicitly uses type
checker with 'errorTypesEqualToAnything=false'.
Also, this change might be ultimately seen as small improvement, because
if one extracts something with error type, they would certainly prefer
it to have a proper type as soon as errors are resolved (i.e. additional
code/imports written), rather than having a useless Any-type.
Several quick fix tests are flaky thanks to MakeOverrideMemberOpenFix
class. Flakiness is probably caused by `myQuickFixInfo: QuickFixInfo`
field. When there's no memory pressure, there's no resolve in dispatch
thread, but value may be invalidated because of soft reference usage
and re-evaluating might cause the test failure.
Caused by: org.jetbrains.kotlin.idea.caches.resolve.KotlinIdeaResolutionException: Kotlin resolution encountered a problem while analyzing KtNamedFunction
at org.jetbrains.kotlin.idea.caches.resolve.ResolutionFacadeWithDebugInfo.analyze(ResolutionFacadeWithDebugInfo.kt:44)
at org.jetbrains.kotlin.idea.caches.resolve.ExtendedResolutionApiKt.analyze(extendedResolutionApi.kt:97)
at org.jetbrains.kotlin.idea.caches.resolve.ExtendedResolutionApiKt.resolveToDescriptorIfAny(extendedResolutionApi.kt:39)
at org.jetbrains.kotlin.idea.caches.resolve.ResolutionUtils.resolveToDescriptorIfAny(resolutionApi.kt:60)
at org.jetbrains.kotlin.idea.quickfix.MakeOverriddenMemberOpenFix.computeInfo(MakeOverriddenMemberOpenFix.kt:54)
at org.jetbrains.kotlin.idea.quickfix.MakeOverriddenMemberOpenFix.access$computeInfo(MakeOverriddenMemberOpenFix.kt:38)
at org.jetbrains.kotlin.idea.quickfix.MakeOverriddenMemberOpenFix$myQuickFixInfo$2.invoke(MakeOverriddenMemberOpenFix.kt:41)
at org.jetbrains.kotlin.idea.quickfix.MakeOverriddenMemberOpenFix$myQuickFixInfo$2.invoke(MakeOverriddenMemberOpenFix.kt:38)
at org.jetbrains.kotlin.idea.core.util.CachedValueHelpersKt$sam$com_intellij_psi_util_CachedValueProvider$0.compute(CachedValueHelpers.kt)
at com.intellij.psi.impl.PsiCachedValueImpl.doCompute(PsiCachedValueImpl.java:54)
at com.intellij.util.CachedValueBase.lambda$getValueWithLock$0(CachedValueBase.java:228)
at com.intellij.util.IdempotenceChecker.applyForRandomCheck(IdempotenceChecker.java:336)
at com.intellij.util.CachedValueBase.getValueWithLock(CachedValueBase.java:228)
at com.intellij.psi.impl.PsiCachedValueImpl.getValue(PsiCachedValueImpl.java:43)
at org.jetbrains.kotlin.idea.core.util.CachedValueHelpersKt.getValue(CachedValueHelpers.kt:25)
at org.jetbrains.kotlin.idea.quickfix.MakeOverriddenMemberOpenFix.getMyQuickFixInfo(MakeOverriddenMemberOpenFix.kt)
at org.jetbrains.kotlin.idea.quickfix.MakeOverriddenMemberOpenFix.getContainingDeclarationsNames(MakeOverriddenMemberOpenFix.kt:45)
at org.jetbrains.kotlin.idea.quickfix.MakeOverriddenMemberOpenFix.getText(MakeOverriddenMemberOpenFix.kt:89)
at com.intellij.codeInsight.intention.impl.IntentionActionWithTextCaching$MyIntentionAction.getText(IntentionActionWithTextCaching.java:165)
at com.intellij.testFramework.fixtures.impl.CodeInsightTestFixtureImpl.lambda$invokeIntention$52(CodeInsightTestFixtureImpl.java:1933)
at com.intellij.openapi.application.TransactionGuardImpl$2.run(TransactionGuardImpl.java:201)
at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:802)
at com.intellij.openapi.application.impl.ApplicationImpl.lambda$invokeLater$4(ApplicationImpl.java:322)
at com.intellij.openapi.application.impl.FlushQueue.doRun(FlushQueue.java:84)
at com.intellij.openapi.application.impl.FlushQueue.runNextEvent(FlushQueue.java:132)
at com.intellij.openapi.application.impl.FlushQueue.flushNow(FlushQueue.java:47)
at com.intellij.openapi.application.impl.FlushQueue$FlushNow.run(FlushQueue.java:188)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:311)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:758)
at java.awt.EventQueue.access$500(EventQueue.java:97)
at java.awt.EventQueue$3.run(EventQueue.java:709)
at java.awt.EventQueue$3.run(EventQueue.java:703)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:74)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:728)
at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:965)
at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:838)
at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$8(IdeEventQueue.java:449)
at com.intellij.openapi.progress.impl.CoreProgressManager.computePrioritized(CoreProgressManager.java:733)
at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$9(IdeEventQueue.java:448)
at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:802)
at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:496)
at sun.reflect.GeneratedMethodAccessor58.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at com.intellij.util.ui.UIUtil.dispatchAllInvocationEvents(UIUtil.java:1738)
at com.intellij.testFramework.fixtures.impl.CodeInsightTestFixtureImpl.lambda$invokeIntention$53(CodeInsightTestFixtureImpl.java:1939)
at com.intellij.testFramework.fixtures.impl.CodeInsightTestFixtureImpl.withReadOnlyFile(CodeInsightTestFixtureImpl.java:1960)
at com.intellij.testFramework.fixtures.impl.CodeInsightTestFixtureImpl.invokeIntention(CodeInsightTestFixtureImpl.java:1929)
at com.intellij.testFramework.fixtures.impl.CodeInsightTestFixtureImpl.lambda$launchAction$14(CodeInsightTestFixtureImpl.java:680)
at com.intellij.testFramework.EdtTestUtil$Companion$runInEdtAndWait$1.invoke(EdtTestUtil.kt:18)
at com.intellij.testFramework.EdtTestUtil$Companion$runInEdtAndWait$1.invoke(EdtTestUtil.kt:13)
at com.intellij.testFramework.EdtTestUtilKt.runInEdtAndWait(EdtTestUtil.kt:44)
at com.intellij.testFramework.EdtTestUtil$Companion.runInEdtAndWait(EdtTestUtil.kt:18)
at com.intellij.testFramework.EdtTestUtil.runInEdtAndWait(EdtTestUtil.kt)
at com.intellij.testFramework.fixtures.impl.CodeInsightTestFixtureImpl.launchAction(CodeInsightTestFixtureImpl.java:680)
at org.jetbrains.kotlin.idea.quickfix.AbstractQuickFixTest$applyAction$stubComparisonFailure$1.invoke(AbstractQuickFixTest.kt:176)
at org.jetbrains.kotlin.idea.quickfix.AbstractQuickFixTest$applyAction$stubComparisonFailure$1.invoke(AbstractQuickFixTest.kt:34)
at org.jetbrains.kotlin.idea.caches.resolve.ResolveInDispatchThreadManager.runWithForceCheckForResolveInDispatchThreadInTests$idea_core(ResolveInDispatchThreadManager.kt:115)
at org.jetbrains.kotlin.idea.caches.resolve.ResolveInDispatchThreadManagerKt.forceCheckForResolveInDispatchThreadInTests(ResolveInDispatchThreadManager.kt:40)
at org.jetbrains.kotlin.idea.quickfix.AbstractQuickFixTest.applyAction(AbstractQuickFixTest.kt:175)
at org.jetbrains.kotlin.idea.quickfix.AbstractQuickFixTest.access$applyAction(AbstractQuickFixTest.kt:34)
at org.jetbrains.kotlin.idea.quickfix.AbstractQuickFixTest$doKotlinQuickFixTest$1.run(AbstractQuickFixTest.kt:125)
at com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:220)
at com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:177)
at com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:167)
at com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:153)
at org.jetbrains.kotlin.idea.quickfix.AbstractQuickFixTest.doKotlinQuickFixTest(AbstractQuickFixTest.kt:96)
at org.jetbrains.kotlin.idea.quickfix.AbstractQuickFixTest.access$doKotlinQuickFixTest(AbstractQuickFixTest.kt:34)
at org.jetbrains.kotlin.idea.quickfix.AbstractQuickFixTest$doTest$1.invoke(AbstractQuickFixTest.kt:60)
at org.jetbrains.kotlin.idea.quickfix.AbstractQuickFixTest$doTest$1.invoke(AbstractQuickFixTest.kt:34)
at org.jetbrains.kotlin.idea.test.KotlinLightCodeInsightFixtureTestCaseKt.withCustomCompilerOptions(KotlinLightCodeInsightFixtureTestCase.kt:253)
at org.jetbrains.kotlin.idea.quickfix.AbstractQuickFixTest.doTest(AbstractQuickFixTest.kt:55)
at org.jetbrains.kotlin.test.KotlinTestUtils.lambda$testWithCustomIgnoreDirective$6(KotlinTestUtils.java:803)
at org.jetbrains.kotlin.test.MuteWithFileKt$testWithMuteInFile$1.invoke(muteWithFile.kt:41)
at org.jetbrains.kotlin.test.KotlinTestUtils.runTestImpl(KotlinTestUtils.java:773)
at org.jetbrains.kotlin.test.KotlinTestUtils.runTest(KotlinTestUtils.java:716)
at org.jetbrains.kotlin.idea.quickfix.QuickFixTestGenerated$Override.runTest(QuickFixTestGenerated.java:10025)
at org.jetbrains.kotlin.idea.quickfix.QuickFixTestGenerated$Override.testOverridingDelegatedMethod(QuickFixTestGenerated.java:10074)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at junit.framework.TestCase.runTest(TestCase.java:176)
at com.intellij.testFramework.UsefulTestCase.lambda$runTest$9(UsefulTestCase.java:327)
at com.intellij.testFramework.UsefulTestCase.lambda$invokeTestRunnable$10(UsefulTestCase.java:364)
at com.intellij.testFramework.EdtTestUtilKt.runInEdtAndWait(EdtTestUtil.kt:44)
at com.intellij.testFramework.UsefulTestCase.invokeTestRunnable(UsefulTestCase.java:363)
at com.intellij.testFramework.UsefulTestCase.runTest(UsefulTestCase.java:346)
at org.jetbrains.kotlin.idea.test.KotlinLightCodeInsightFixtureTestCaseBase.lambda$runTest$0(KotlinLightCodeInsightFixtureTestCaseBase.java:92)
at org.jetbrains.kotlin.test.KotlinTestUtils.lambda$runTestWithThrowable$4(KotlinTestUtils.java:726)
... 36 more
Caused by: org.jetbrains.kotlin.idea.caches.resolve.ResolveInDispatchThreadException: Resolve is not allowed under the write action for `org.jetbrains.kotlin.idea.quickfix.MakeOverriddenMemberOpenFix`!
at org.jetbrains.kotlin.idea.quickfix.AbstractQuickFixTest$applyAction$writeActionResolveHandler$1.invoke(AbstractQuickFixTest.kt:170)
at org.jetbrains.kotlin.idea.quickfix.AbstractQuickFixTest$applyAction$writeActionResolveHandler$1.invoke(AbstractQuickFixTest.kt:34)
at org.jetbrains.kotlin.idea.caches.resolve.ResolveInDispatchThreadManager.assertNoResolveInDispatchThread$idea_core(ResolveInDispatchThreadManager.kt:73)
at org.jetbrains.kotlin.idea.caches.resolve.ModuleResolutionFacadeImpl.analyze(ModuleResolutionFacadeImpl.kt:60)
at org.jetbrains.kotlin.idea.caches.resolve.ModuleResolutionFacadeImpl.analyze(ModuleResolutionFacadeImpl.kt:56)
at org.jetbrains.kotlin.idea.caches.resolve.ResolutionFacadeWithDebugInfo.analyze(ResolutionFacadeWithDebugInfo.kt:45)
... 126 more
- `kotlin.dom` does not need this because it contains only extensions
- Add test for launching whole project fix; mute it because currently it
does not pass
- The test fails because in tests `RefJavaManager` tries to create
`RefJavaFileImpl` for .kt files. It will try to use UAST, but it
does not work for JS files. In production this is disabled, so no
problems occur
- This inspection allows to migrate from `kotlin.dom|kotlin.browser`
to `kotlinx.dom|kotlinx.browser` packages respectively
- This inspection is available from the import statements, and also
from the `Run migrations` action
- ^KT-39869 Fixed