Lilly
12/01/2021, 12:23 AM'public' function exposes its 'internal' parameter type...
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?Zach Klippenstein (he/him) [MOD]
12/01/2021, 12:35 AMAPI
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.Lilly
12/01/2021, 12:39 AM