intervals
is a List[ParentType]
, so you must define _key
and _value
inside of ParentType
if you want to access them:
sealed trait ParentType {
val _key: Any
val _value: Any
}
Also, it would be more succinct to mark the constructor parameters with val
:
sealed trait ParentType {
val _key: Any
val _value: Any
}
class ChildType1(val _key: Int, val _value: Int) extends ParentType