[#658] | project: specification | priority: low | category: missing feature | |
---|---|---|---|---|
submitter | assigned to | status | date submitted | |
Burak | Martin | won't fix | 2006-07-14 18:22:14.0 | |
subject | overriding and RepeatedParam | |||
code |
abstract class No { def bar: Seq[String] = null def foo(s:Seq[String]) = {} } class Qux extends No { override def foo(s:String*) = {} override def bar = null } case class Yg(override val bar:String*) extends No; // this works, however |
|||
what happened | overriding Seq[T] with T* is inconsistent. |
|||
what expected | overriding to work fine. This would mean that the following code passes:
val x = new Qux() val y:No = x x.foo("1","2","3") // am calling String* methods y.foo(List("1","2","3")) // have to call Seq[String] methodThe real use-case is to override a getter/setter pair "def x, def x_=(value:Seq[T])" of Seq[T] with "override var x:T*" which is currently not possible. |
|||
[back to overview] |
Burak edited on 2006-07-14 18:25:13.0 |
small typo in "real use-case" |
Martin edited on 2006-08-20 18:41:26.0 |
changed to a spec missing feature |
Martin edited on 2006-12-06 15:47:14.0 |
Thinking about is, I believe this would open an unnecessarily big can of worms. Also the use case will not work anyway, since T* is not allowed as a type of a var. |