Does anyone use function like this? ``` inline fun...
# codereview
b
Does anyone use function like this?
Copy code
inline fun <reified T> Any._as() = this as T
Or it's just noise?
r
I can see the motivation, as it's kind of annoying to have to put the whole expression into parens to cast and use it in the same statement, but I'd be wary of the auto-complete pollution
o
I’d call it
cast
2
u
personally I'm using
unsafeCast
and
safeCast
(with
as?
) in my projects