なぜscalaは以下のコードについて文句を言うのですか?
scala> class Http(var status: Int)
defined class Http
scala> case class Post(url: String, data: String, status: Int) extends Http(status)
<console>:8: error: overriding variable status in class Http of type Int;
value status needs `override' modifier
case class Post(url: String, data: String, status: Int) extends Http(status)
^
scala> case class Post(url: String, data: String, sta: Int) extends Http(sta)
defined class Post
しかし、これは問題なく実行されます。
scala> class C(boo:Int)
defined class C
scala> case class D(far:Int, boo:Int) extends C(boo)
defined class D