fork download
  1. sealed trait SeqValue {
  2. def seq:Int
  3. def value:Float
  4. override def toString = null
  5. }
  6.  
  7. sealed trait Calc {
  8. type S <: SeqValue
  9. def recalc(input:S):SeqValue
  10. }
  11.  
  12. case class Price(seq:Int=0, value:Float=.0f) extends SeqValue with Calc {
  13. type S = SeqValue
  14. def recalc(input:SeqValue) = Price(1 + seq, input.value)
  15. }
  16.  
  17. object Main {
  18. def main(args: Array[String]){
  19. }
  20. }
Success #stdin #stdout 0.03s 211328KB
stdin
Standard input is empty
stdout
Standard output is empty