Why do I get the error below? How to workaround it?
I assumed that since A and B compile to (interface,class) pairs, it\'s a matter of choosing the right static meth
I had the same problem and I didn't like to have to create an intermediary trait because I can have 4,5 or even 6 traits with the same methods, because it is traits containing CRUD operations (find, create...). Furthermore I needed to use those trait together only for test purpose and I always try to avoid as much as possible to modify the structure of my project only to make my test easier. So I simply implemented those traits in different objects :
class somethingToTest {
object AImpl extends ATrait
object BImpl extends BTrait
val a = AImpl.methodDuplicated()
val b = BImpl.methodDuplicated()
}
It is probably not the most clever way to use traits but it doesn't require any change in the project's code, it only implies to have a bit more code in the tests.