I have defined a library through a version catalog...
# gradle
u
I have defined a library through a version catalog (
libs.skeleton.core.library
). When I try to access the group of that dependency:
Copy code
val group : String = libs.skeleton.core.library.get().group
the compiler can not agree about the nullability of the return value. It complains, that
libs.skeleton.core.library.get().group
is nullable. If I add an Elvis, it warns, that the expression can never be null. The issue is with the return value of the
get()
being
MinimalExternalModuleDependency
which implements two java interfaces
ModuleDependency
and
ModuleVersionSelector
. Both declare
getGroup
but
ModuleDependency
declares the return value as nullable. This seems like a bug to me. If
MinimalExternalModuleDependency
implements
ModuleVersionSelector
it promises to never return null, no matter what
ModuleDependency
declares.