Join Slack
Powered by
Does anyone use function like this? ``` inline fun...
# codereview
b
beholder
09/06/2018, 12:32 PM
Does anyone use function like this?
Copy code
inline fun <reified T> Any._as() = this as T
Or it's just noise?
r
robin
09/06/2018, 12:34 PM
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
orangy
09/06/2018, 4:48 PM
I’d call it
cast
➕ 2
u
uhe
09/07/2018, 9:24 AM
personally I'm using
unsafeCast
and
safeCast
(with
as?
) in my projects
5
Views
Open in Slack
Previous
Next