arve
12/05/2018, 9:46 AMpackage somePkg
interface MyInterface {
fun myFun(): MyType
data class MyType
}
I don't want to pollute somePkg
with MyType
, since it's pretty specific to the domain of MyInterface
, and there is other stuff in the same package. Are there any pitfalls to defining a data class inside an interface that I should be aware of? What about putting it inside companion object inside the interface? Is the only difference in the import statement you have to use?diesieben07
12/05/2018, 9:55 AMkarelpeeters
12/05/2018, 10:01 AMinner
classes can access private members though.arve
12/05/2018, 10:02 AMinner
keyword is required to access private members (ref. https://kotlinlang.org/docs/reference/nested-classes.html)
However that's beside the question I'm asking šdiesieben07
12/05/2018, 10:05 AMarve
12/05/2018, 10:07 AMprivate
part of your statement š You are rightkarelpeeters
12/05/2018, 10:08 AMdiesieben07
12/05/2018, 10:08 AMarve
12/05/2018, 10:08 AMdiesieben07
12/05/2018, 10:09 AM.kt
file, too.arve
12/05/2018, 12:33 PMaarjav
12/05/2018, 1:34 PMarve
12/05/2018, 2:46 PM