https://kotlinlang.org logo
#android
Title
# android
a

adams2

08/27/2019, 3:39 PM
why is this not a compile error due to
@Nullable
on findViewById conflicting with
T : View
(it's not
T : View?
)
r

reline

08/27/2019, 4:19 PM
findViewById<T>(res)
resolves to
T!
on my machine so it looks like
@Nullable
isn’t resolving the return value correctly. You can always do
findViewById<T?>(res)
instead to force nullable.
✔️ 1
There’s also
requireViewById<T>(res)