title: Junit 5 Assertions.fail() can not infer type in Kotlin
body: <p>When I attempt to use JUnit 5 Assertions.fail in my Kotlin tests I get a compilation failure because parameter V can not be inferred:</p>
  
  <pre><code>import org.junit.jupiter.api.Assertions.fail
  internal class MyTests {
     @Test
     fun simpleTest() {
       fail("Does not compile") 
     }
  }
  </code></pre>
  
  <p>Of course a simple solution to this problem is:</p>
  
  <pre><code>import org.junit.jupiter.api.Assertions.fail
  internal class MyTests {
     @Test
     fun simpleTest() {
       val result: Any = fail("Compiles") 
     }
  }
  </code></pre>
  
  <p>However I do not wish to have to create an unused value in my code. Is there a way to define the type without having to declare a val? Also why does this happen in Kotlin? Java has no such problem with generics:</p>
  
  <pre><code>import org.junit.jupiter.api.Assertions.fail;
  class MyJavaTests {
      @Test
      public void simpleTest() {
          fail("Compiles);
      }
  }
  </code></pre>
  
  <p>EDIT: I discovered immediately after posting the question that the solution is to parameterize the call:</p>
  
  <pre><code>import org.junit.jupiter.api.Assertions.fail
  internal class MyTests {
     @Test
     fun simpleTest() {
       fail&lt;Any&gt;("Does not compile") 
     }
   }
  </code></pre>
  
  <p>However still willing to accept an answer that can explain why I need to do this in kotlin.</p>