aishwaryabhishek3
04/27/2023, 9:09 AMinternal interface Mapper
class UseCase(private val mapper)
Why does compiler say ‘public’ function exposes its ‘internal’ parameter type when it is a private val mapper
CLOVIS
04/27/2023, 9:12 AMUseCase
's constructor is public, so it can be called outside your module. However, Mapper
is internal, so it can't be used outside your module. The result is that it's not possible to call the constructor outside the module.
You can make UseCase
's constructor internal:
class UseCase internal constructor(private val mapper: Mapper)
aishwaryabhishek3
04/27/2023, 9:13 AM