In 1.1-M04, the following code fails when executed...
# eap
n
In 1.1-M04, the following code fails when executed:
Copy code
fun test() {
    val action = mock<() -> Unit>()
    MyJavaClass().doSomething(action)
}

public class MyJavaClass {

    void doSomething(Runnable r) {
        r.run();
    }
}
Now
mock<() -> Unit>()
uses Mockito to create a mock object. This mock object will by default return
null
when invoked:
action.invoke()
will return
null
. Since M04, the following ISE is thrown:
Copy code
java.lang.IllegalStateException: invoke(...) must not be null

	at test.SAMTestKt$sam$Runnable$3ede1671.run(SAMTest.kt)
	at test.MyJavaClass.doSomething(MyJavaClass.java:6)
	at test.SAMTest.test(SAMTest.kt:12)
Is this intended?