What was the rationale for the `Any` argument in t...
# stdlib
e
What was the rationale for the
Any
argument in the
error
function?
Copy code
public inline fun error(message: Any): Nothing = throw IllegalStateException(message.toString())
Isn't it risky allowing passing in all types of data?
👀 1
w
Risky how?
e
Accidentally passing in an unrelated object. No error, goes unnoticed until runtime.
w
Yeah I can see how e.g.
error { "foo" }
might be not useful 🤔