In my scala app I have two abstract classes:
abstract class Definition
abstract class Evaluator[T <: Definition]
I also have some definitions and corresponding evaluators. What I'm trying to create is class that would look like this:
abstract class AbstractEvaluationContext[E <: Evaluator[D]]
with some methods.
My question is: how can I access the type of definition that is to be evaluated by the evaluator. eg. with class:
class SomeEvaluationContext extends AbstractEvaluationContext[SomeEvaluator[SomeDefinition]]
how can I get the type SomeDefinition in my AbstractEvaluationContext class?
For example I would like to define a method:
def getDefinition(): D = ...
which return type would be the definition passed as evaluator parameter.