<Junit 5 Assertions.fail() can not infer type in K...
# stackoverflow
u
Junit 5 Assertions.fail() can not infer type in Kotlin 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: import org.junit.jupiter.api.Assertions.fail internal class MyTests { @Test fun simpleTest() { fail("Does not compile") } } Of course a simple solution to this problem is: import org.junit.jupiter.api.Assertions.fail internal class MyTests { @Test fun simpleTest() { val result: Any = fail("Compiles") } } However I do not wish...