I need some help on this scenario:
A trait defines an shared interface with some methods.
One of the methods should look like this
def fromConfig( config : Config):
Each implementation should override the method with something like:
override def fromConfig(config: SubConfigA)
However, doing so gives "Method .. overrides nothing" error
even though the config stuff is defined as
abstract class Config
trait SubConfigA extends Config
trait SubConfigB extends Config
....
I remember, in Java you actually can define an interface as parameter,
and use sub-interfaces in subclasses for refinement.
Apparently the same does not work in Scala.
The code above is just a draft but the idea is passing
specific configurations matching to a specific implementation
of the shared interface.
Any idea or advice would be most appreciated.
Thank you