title: KtVisitorVoid can not cast to PsiElementVisitor in Kotlin IntelliJ plugin
body: <p>I am trying to learn to build an IntelliJ plugin, I am trying to build something that works on Kotlin files. I am using the Kotlin plugin but it seems <code>KtVisitorVoid</code> class (<a href="https://github.com/JetBrains/kotlin/blob/master/compiler/psi/src/org/jetbrains/kotlin/psi/KtVisitorVoid.java" rel="nofollow noreferrer">psi/src/org/jetbrains/kotlin/psi/KtVisitorVoid.java</a>) can not be cast to <code>PsiElementVisitor</code>.</p>
  <p>This is the current code throwing the error:</p>
  <pre><code>class HelloWorldWithKotlinClassesInspection : AbstractKotlinInspection() {
  
      override fun buildVisitor(holder: ProblemsHolder, isOnTheFly: Boolean): PsiElementVisitor {
          return object : KtVisitorVoid() {
            //
          }
      }
  }
  </code></pre>
  <p>The error I get is :</p>
  <blockquote>
  <p>2021-11-12 08:22:50,880 [ 333360]  ERROR -
  aemon.impl.PassExecutorService - class
  com.github.me.KotlinInspection$buildVisitor$1
  cannot be cast to class com.intellij.psi.PsiElementVisitor
  (com.github.me.KotlinInspection$buildVisitor$1
  is in unnamed module of loader
  com.intellij.ide.plugins.cl.PluginClassLoader @6be5f3e1;
  com.intellij.psi.PsiElementVisitor is in unnamed module of loader
  com.intellij.util.lang.UrlClassLoader @7921b0a2)
  java.lang.ClassCastException: class
  com.github.me.KotlinInspection$buildVisitor$1
  cannot be cast to class com.intellij.psi.PsiElementVisitor
  (com.github.me.KotlinInspection$buildVisitor$1
  is in unnamed module of loader
  com.intellij.ide.plugins.cl.PluginClassLoader @6be5f3e1;
  com.intellij.psi.PsiElementVisitor is in unnamed module of loader
  com.intellij.util.lang.UrlClassLoader @7921b0a2)</p>
  </blockquote>