[Solved] How can I work around > 'public' funct...
# android
l
[Solved] How can I work around
'public' function exposes its 'internal' parameter type...
Copy code
internal interface Cache

// Public API
class API(private val cache: Cache) { // compile error --> 'public' function exposes its 'internal' parameter type
   // Cache is not exposed, just used internally
}
Cache
is not part of the public API but it is used in the class that represents the public API (public API of the library/module). What options do I have?
z
It’s complaining because the
API
constructor is public, which means anyone can see and call the method, but they’d be required to pass in an instance of a type that they can’t see. You could make the constructor internal.
l
You saved my day @Zach Klippenstein (he/him) [MOD] ❤️
562 Views