Reputation: 792
I have the following classes
trait Identifiable
case class Address extends Identifiable
abstract class AbstractTable[T] {
type TableElementType
}
class TableQuery[E <: AbstractTable[_]]
class Addresses(tag: Tag) extends Table[Address](tag, "addresses")
How to make the
abstract class AbstractOptionBaseRepsitory[T <: AbstractTable[_]]
accept only T
where T#TableElementType
is a subclass of Identifiable
Upvotes: 1
Views: 49
Reputation: 40510
How about
abstract class IdentifiableAbstractTable[T] extends AbstractTable[T] {
type TableElementType <: Identifiable
}
abstract class AbstractOptionBaseRepository[T <: IdentifiableAbstractTable[_]]
Upvotes: 1