Though the php plugin was failing a lot as well when duplicate class names exist in different namespaces ( 1 in global, one not ) when moving a class from global namespace
com.jetbrains.php.lang.psi.elements.impl.PhpClassImpl$MyRenamableFakePsiElement cannot be cast to com.jetbrains.php.lang.psi.elements.impl.FieldImpl
java.lang.ClassCastException: com.jetbrains.php.lang.psi.elements.impl.PhpClassImpl$MyRenamableFakePsiElement cannot be cast to com.jetbrains.php.lang.psi.elements.impl.FieldImpl
at com.ptby.dynamicreturntypeplugin.index.OriginalCallAnalyzer.getFieldInstanceOriginalReturnType(OriginalCallAnalyzer.kt:46)
at com.ptby.dynamicreturntypeplugin.index.FieldReferenceAnalyzer.getClassNameFromFieldLookup(FieldReferenceAnalyzer.kt:37)
at com.ptby.dynamicreturntypeplugin.signatureconversion.CustomSignatureProcessor.processSignature(CustomSignatureProcessor.kt:48)
at com.ptby.dynamicreturntypeplugin.signatureconversion.CustomSignatureProcessor.getBySignature(CustomSignatureProcessor.kt:28)
at com.ptby.dynamicreturntypeplugin.DynamicReturnTypeProvider.processSingleSignature(DynamicReturnTypeProvider.kt:126)
at com.ptby.dynamicreturntypeplugin.DynamicReturnTypeProvider.getBySignature(DynamicReturnTypeProvider.kt:106)
at com.jetbrains.php.PhpIndexImpl.getBySignatureInternal(PhpIndexImpl.java:398)
at com.jetbrains.php.PhpIndexImpl.getBySignature(PhpIndexImpl.java:284)
at com.jetbrains.php.PhpIndexImpl.completeType(PhpIndexImpl.java:80)
at com.jetbrains.php.lang.psi.resolve.types.PhpType.global(PhpType.java:418)
at com.jetbrains.php.lang.inspections.PhpVoidFunctionResultUsedInspection.analyzeCall(PhpVoidFunctionResultUsedInspection.java:47)
at com.jetbrains.php.lang.inspections.PhpVoidFunctionResultUsedInspection.access$000(PhpVoidFunctionResultUsedInspection.java:21)
at com.jetbrains.php.lang.inspections.PhpVoidFunctionResultUsedInspection$1.visitPhpMethodReference(PhpVoidFunctionResultUsedInspection.java:39)
at com.jetbrains.php.lang.psi.elements.impl.MethodReferenceImpl.accept(MethodReferenceImpl.java:31)
at com.intellij.codeInspection.InspectionEngine.acceptElements(InspectionEngine.java:80)
at com.intellij.codeInsight.daemon.impl.LocalInspectionsPass$4.process(LocalInspectionsPass.java:313)
at com.intellij.codeInsight.daemon.impl.LocalInspectionsPass$4.process(LocalInspectionsPass.java:308)
at com.intellij.concurrency.ApplierCompleter.a(ApplierCompleter.java:122)
at com.intellij.concurrency.ApplierCompleter.access$000(ApplierCompleter.java:44)
at com.intellij.concurrency.ApplierCompleter$1.run(ApplierCompleter.java:85)
at com.intellij.openapi.application.impl.ApplicationImpl.tryRunReadAction(ApplicationImpl.java:1143)
at com.intellij.concurrency.ApplierCompleter$2.run(ApplierCompleter.java:94)
at com.intellij.openapi.progress.impl.ProgressManagerImpl.a(ProgressManagerImpl.java:281)
at com.intellij.openapi.progress.impl.ProgressManagerImpl.a(ProgressManagerImpl.java:278)
at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:233)
at com.intellij.concurrency.ApplierCompleter.a(ApplierCompleter.java:106)
at com.intellij.concurrency.ApplierCompleter.compute(ApplierCompleter.java:82)
at jsr166e.CountedCompleter.exec(CountedCompleter.java:684)
at jsr166e.ForkJoinTask.doExec(ForkJoinTask.java:260)
at jsr166e.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:858)
at jsr166e.ForkJoinPool.scan(ForkJoinPool.java:1687)
at jsr166e.ForkJoinPool.runWorker(ForkJoinPool.java:1642)
at jsr166e.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:109)
Though the php plugin was failing a lot as well when duplicate class names exist in different namespaces ( 1 in global, one not ) when moving a class from global namespace
com.jetbrains.php.lang.psi.elements.impl.PhpClassImpl$MyRenamableFakePsiElement cannot be cast to com.jetbrains.php.lang.psi.elements.impl.FieldImpl java.lang.ClassCastException: com.jetbrains.php.lang.psi.elements.impl.PhpClassImpl$MyRenamableFakePsiElement cannot be cast to com.jetbrains.php.lang.psi.elements.impl.FieldImpl at com.ptby.dynamicreturntypeplugin.index.OriginalCallAnalyzer.getFieldInstanceOriginalReturnType(OriginalCallAnalyzer.kt:46) at com.ptby.dynamicreturntypeplugin.index.FieldReferenceAnalyzer.getClassNameFromFieldLookup(FieldReferenceAnalyzer.kt:37) at com.ptby.dynamicreturntypeplugin.signatureconversion.CustomSignatureProcessor.processSignature(CustomSignatureProcessor.kt:48) at com.ptby.dynamicreturntypeplugin.signatureconversion.CustomSignatureProcessor.getBySignature(CustomSignatureProcessor.kt:28) at com.ptby.dynamicreturntypeplugin.DynamicReturnTypeProvider.processSingleSignature(DynamicReturnTypeProvider.kt:126) at com.ptby.dynamicreturntypeplugin.DynamicReturnTypeProvider.getBySignature(DynamicReturnTypeProvider.kt:106) at com.jetbrains.php.PhpIndexImpl.getBySignatureInternal(PhpIndexImpl.java:398) at com.jetbrains.php.PhpIndexImpl.getBySignature(PhpIndexImpl.java:284) at com.jetbrains.php.PhpIndexImpl.completeType(PhpIndexImpl.java:80) at com.jetbrains.php.lang.psi.resolve.types.PhpType.global(PhpType.java:418) at com.jetbrains.php.lang.inspections.PhpVoidFunctionResultUsedInspection.analyzeCall(PhpVoidFunctionResultUsedInspection.java:47) at com.jetbrains.php.lang.inspections.PhpVoidFunctionResultUsedInspection.access$000(PhpVoidFunctionResultUsedInspection.java:21) at com.jetbrains.php.lang.inspections.PhpVoidFunctionResultUsedInspection$1.visitPhpMethodReference(PhpVoidFunctionResultUsedInspection.java:39) at com.jetbrains.php.lang.psi.elements.impl.MethodReferenceImpl.accept(MethodReferenceImpl.java:31) at com.intellij.codeInspection.InspectionEngine.acceptElements(InspectionEngine.java:80) at com.intellij.codeInsight.daemon.impl.LocalInspectionsPass$4.process(LocalInspectionsPass.java:313) at com.intellij.codeInsight.daemon.impl.LocalInspectionsPass$4.process(LocalInspectionsPass.java:308) at com.intellij.concurrency.ApplierCompleter.a(ApplierCompleter.java:122) at com.intellij.concurrency.ApplierCompleter.access$000(ApplierCompleter.java:44) at com.intellij.concurrency.ApplierCompleter$1.run(ApplierCompleter.java:85) at com.intellij.openapi.application.impl.ApplicationImpl.tryRunReadAction(ApplicationImpl.java:1143) at com.intellij.concurrency.ApplierCompleter$2.run(ApplierCompleter.java:94) at com.intellij.openapi.progress.impl.ProgressManagerImpl.a(ProgressManagerImpl.java:281) at com.intellij.openapi.progress.impl.ProgressManagerImpl.a(ProgressManagerImpl.java:278) at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:233) at com.intellij.concurrency.ApplierCompleter.a(ApplierCompleter.java:106) at com.intellij.concurrency.ApplierCompleter.compute(ApplierCompleter.java:82) at jsr166e.CountedCompleter.exec(CountedCompleter.java:684) at jsr166e.ForkJoinTask.doExec(ForkJoinTask.java:260) at jsr166e.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:858) at jsr166e.ForkJoinPool.scan(ForkJoinPool.java:1687) at jsr166e.ForkJoinPool.runWorker(ForkJoinPool.java:1642) at jsr166e.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:109)