type mismatch; found : IDataContext[_$1] where type _$1 <: DBObject required: IDataContext[DBObject] Note: _$1 <: DBObject, but class IDataContext is invariant in type A. You may wish to define A as +A instead. (SLS 4.5)
This problematic part "required: IDataContext[DBObject]" is actually defined like this.
abstract class IDataContextBuilder[+A <: DBObject] {
def initXDataPoints(dataContext: IDataContext[A]): Unit
}
I changed it to following and it works but it looks quite redundant
abstract class IDataContextBuilder[+A <: DBObject] {
def initXDataPoints[A <: DBObject](dataContext: IDataContext[A]): Unit
}
Now issue is in implementation of above method:
override def initXDataPoints[Dim1Agg](dataContext: IDataContext[Dim1Agg]): Unit = { ...}
method initXDataPoints overrides nothing. Note: the super classes of class Dim1DataContextBuilder contain the following, non final members named initXDataPoints: def initXDataPoints[A <: DBObject](dataContext: IDataContext[A]): Unit
Dim1Agg is subtype of DBObject