scala - Type upper bounds and inheritance -
Suppose we have a class pair and some heritage tree:
Class pair [T & LT: Comparative [T]] (R: T, T: T) {Df size relabations = R. Copretto (T)} Seal class person (val significance: IT) in comparative [person] {Override DRF Comparison (o: person): int = ??? } Student student in class (10) provides class teacher (50)
How to modify the uppercase to be able to create a couple [student] now?
(original) (original) (new student, new student) / * Student does not correspond to comparative * /
Maybe it helps:
val notixed = new pair (new student, (new student) .asInstanceOf [person]) Code>
Comments
Post a Comment