title: how do I fix type mismatch: @ExtendWith(SpringExtension::class) KClass -> Class in intelij?
body: <p>I'm using intellij community 2018.2 and gradle 4.9 with kotlin 1.2.60</p>
  
  <p>I've just downloaded a springboot2 pack from start.spring.io with kotlin/gradle support + web + h2 + jpa. I am following <a href="https://spring.io/blog/2018/05/11/new-tutorial-about-spring-boot-and-kotlin" rel="nofollow noreferrer">this</a> official tutorial from spring. </p>
  
  <p><code>gradle build</code> and <code>gradle test</code> both work fine in command line.</p>
  
  <p>In intellij though, I get the following error from the IDE:</p>
  
  <pre><code>Error:(9, 13) Kotlin: Type mismatch: inferred type is    KClass&lt;SpringExtension&gt; but Class was expected
  
  package org.ninrod.blog.blog
  
  import org.junit.jupiter.api.Test
  import org.junit.jupiter.api.extension.ExtendWith
  import org.springframework.boot.test.context.SpringBootTest
  import org.springframework.test.context.junit.jupiter.SpringExtension
  
  @ExtendWith(SpringExtension::class) &lt;-- RIGHT HERE
  @SpringBootTest
  class BlogApplicationTests {
      @Test
      fun contextLoads() {
      } 
  }
  </code></pre>
  
  <p>here is the full source code of the sample: <a href="https://github.com/ninrod/kotlin-springboot2" rel="nofollow noreferrer">link</a>.</p>
  
  <p>How would one fix this in intellij so that the project compiles cleanly as in command line? </p>
  
  <p>ps: here is a screenshot of the problem in intellij:</p>
  
  <p><a href="https://i.stack.imgur.com/DOzcs.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/DOzcs.png" alt="screenshot: build error -&gt; type mismatch kclass -&gt; class"></a></p>