on the subject of rants, anyone else tired of `Ill...
# random
n
on the subject of rants, anyone else tired of
IllegalArgumentException
always auto-completing to
java.lang.IllegalArgumentException
instead of the Kotlin stdlib typealias? same goes for all the common exceptions, like
RuntimeException
m
I can't recall how many years ago I've last used
IllegalArgumentException
😅 When do you use it?
n
in this case it's currently as a placeholder I guess...if an expected environment variable isn't passed to my Lambda. I guess that might be
IllegalStateException
?
m
I typically use
require()
,
check()
and
error()
. The former throws IAEs, the latter two throw ISEs.
👍 1
n
fair, I should be using more of those. I guess I don't love that it wraps the argument, I like the "or else fail" postfix concept
m
What do you mean by “wrap”?
n
wrapper(foo)
m
Nothing is wrapped when you use
require()
🤔
n
require
is the wrapper 😛
it just buries things a little if I'm trying to scan through code
I mean wrapper syntactically, not object-ly
m
Ah okay 🙂
i
I've also been annoyed by this behavior. Took time to reproduce and report it: https://youtrack.jetbrains.com/issue/KTIJ-799
🎉 1