Using Java exception names

Some time ago, for a TestNG test dealing with exception handling, I had the annotation:

  Test(expectedExceptions=arrayOf(javaClass<StackOverflowError>()))


which worked fine. However this now fails at compile time:

  Type inference failed. Expected type mismatch: found: kotlin.Array<java.lang.Class<java.lang.StackOverflowError>> required: kotlin.Array<kotlin.reflect.KClass<*>>

I clearly missed notification of a change, can anyone enlighten me?

It's working fine for me, although when I used

@Test(expectedExceptions = arrayOf(RuntimeException::class))
I'm using 1230.

Lucky you ;-) I always got the "Type inference failed." no matter what I tried in the way of rebuilding.

Fortunately though, your prompt that I should be using:

  Test(expectedExceptions = arrayOf(RuntimeException::class))

made everything work. This is with IntelliJ IDEA 14.1.4 and Kotlin 0.12.655.

Given that the new way works, I suspect I no longer care than the old way is problematic :slight_smile:

Thanks Cédric for that most useful interjection.  

Might be due to the fact you're using 655 and not 1230?