why is this not a compile error due to `@Nullable`...
# android
a
why is this not a compile error due to
@Nullable
on findViewById conflicting with
T : View
(it's not
T : View?
)
r
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)