jtravis
04/02/2018, 9:58 PMinline infix fun <F : Function0<*>, reified E : Throwable> F.shouldThrow(cb: (E) -> Unit) {}
infix fun <F : Function0<*>, E : Exception> F.shouldThrow(exn: E) {}
{ someCode() }.shouldThrow { e: RuntimeException -> /* tada */ }
IDEA is reporting:
Cannot choose among the following candidates without completing type inference
And lists both of the above methods.