title: Incompatible types: A and kotlin.reflect.KType
body: <p>I want to check that function has parameter of <code>A</code> type use the following code:</p>
  
  <pre><code>import kotlin.reflect.*
  import javafx.event.ActionEvent
  
  interface IA {}
  
  class A {}
  
  class B {
      fun test(a: A, ia: IA, event: ActionEvent) {
          println(a)
          println(ia)
          println(event)
      }
  }
  
  fun main(args: Array&lt;String&gt;) {
      for (function in B::class.declaredMemberFunctions) {
          for (parameter in function.parameters) {
              when (parameter.type) {
                  is IA -&gt; println("Has IA interface parameter.")
                  is ActionEvent -&gt; println("Has ActionEvent class parameter.")
                  is A -&gt; println("Has A class parameter.") // &lt;---- compilation error in this line
              }
          }
      }
  }
  </code></pre>
  
  <p>but when I try to compile it I see the following error:</p>
  
  <pre><code>&gt; Error:(20, 19) Incompatible types: A and kotlin.reflect.KType
  </code></pre>
  
  <p>Questions:</p>
  
  <ol>
  <li>Why compiler don't raise error for <code>IA</code> interface and <code>ActionEvent</code> Java class?</li>
  <li>Why compiller raise error for <code>A</code> class?</li>
  <li>How to check that function has argument of <code>A</code> type?</li>
  </ol>