Jacques Smuts
04/01/2019, 11:21 AMJacques Smuts
04/01/2019, 11:23 AMs1m0nw1
04/01/2019, 11:26 AMhho
04/01/2019, 11:27 AMIcaro Temponi
04/01/2019, 11:28 AMbholota
04/01/2019, 11:28 AMthis yeet IllegalStateException()
is closest thing to your example I can imagineJacques Smuts
04/01/2019, 11:35 AMJacques Smuts
04/01/2019, 11:49 AMJacques Smuts
04/01/2019, 11:49 AMkartoffelsup
04/01/2019, 11:53 AMJacques Smuts
04/01/2019, 11:54 AMJacques Smuts
04/01/2019, 11:55 AMribesg
04/01/2019, 12:19 PMinline operator fun Throwable.not(): Nothing = throw this
fun main() {
val error = Throwable()
!error
}
(In the ‘weird things you can do’ category)Jacques Smuts
04/01/2019, 12:20 PMribesg
04/01/2019, 12:22 PMinline operator fun Throwable.invoke(): Nothing = throw this
fun main() {
IllegalStateException()()
}
Jacques Smuts
04/01/2019, 12:22 PMRuckus
04/01/2019, 1:39 PMobject yeet {
inline infix fun new(e: Exception) = throw e
}
if (tRsp.error) {
yeet new Exception()
}
If you want to stick to the original exampleJacques Smuts
04/01/2019, 1:43 PMRuckus
04/01/2019, 1:43 PMBenjamin Charais
04/01/2019, 8:40 PM