yusuf3000
07/02/2018, 10:56 AMinterface Repository<T> {
fun add(model: T): Boolean
}
I have another interface that conforms to `Repository`:
interface TestModelRepository : Repository<TestModel> {
override fun add(model: TestModel): Boolean
}
When I have a class in Swift that conforms to TestModelRepository
class SwiftTestModelRepository: TestModelRepository
it wants me to implement both add
methods. One with type id
and one with type TestModel
. I only want to implement one of them.
Is there a workaround for this where I only implement the overridden one from TestModelRespository
and not from the generic Repository?
As a backup I can only declare add
in TestModelRepository
and remove it from Repository
but this will make the code less clean as I want to have many more repositories that conform to Repository
and would like to reuse the add
method.svyatoslav.scherbina
07/02/2018, 12:02 PMyusuf3000
07/02/2018, 12:13 PMsvyatoslav.scherbina
07/02/2018, 12:40 PM