ScalaMock
ScalaMock copied to clipboard
Option of nested trait causes "method has incompatible type" error
Here is the type I want to macro mock:
trait SimpleService {
trait SomeTypeLike {
val text: String
}
def getSomething: Option[SomeTypeLike]
}
But I get compile error:
method getSomething has incompatible type
However, if I change the return type from Option[SomeTypeLike] to SomeTypeLike it compiles. If I move SomeTypeLike out of SimpleService - compiles too.
Complete sample: https://drive.google.com/file/d/0B54NYsj9RHeaanRsNDVUQjgwMzA/edit?usp=sharing
Thanks. But I'm afraid that this is definitely one of those examples that will have to wait for Palladium
Complied with Scala 3. This can be closed