[#805] | project: compiler | priority: low | category: bug | |
---|---|---|---|---|
submitter | assigned to | status | date submitted | |
Sean | Martin | fixed | 2006-11-07 12:49:22.0 | |
subject | overloading resolution broken for super calls | |||
code |
trait MatcherYYY { trait NodeImpl; trait Matchable extends NodeImpl { protected def doMatch : Unit = {} } } trait BraceMatcherXXX extends MatcherYYY { trait NodeImpl extends super.NodeImpl { def doMatch (braces : BracePair) : Unit } trait BracePair { trait BraceImpl extends NodeImpl with Matchable { override def doMatch : Unit = { super.doMatch; (); } } } } |
|||
what happened | sean-mcdirmids-computer:~/workspace/lampion/src mcdirmid$ ../../scala/build/quick/bin/scalac -d ../bin/ -so\ urcepath . newparser/MatcherYYY.scala newparser/MatcherYYY.scala:18 error: ambiguous reference to overloaded definition, both method doMatch in trait Matchable of type => scala.Unit and method doMatch in trait NodeImpl of type (BraceMatcherXXX.this.BracePair)scala.Unit match expected type ? super.doMatch; ^ one error found |
|||
what expected | ||||
[back to overview] |
Martin edited on 2006-11-10 19:38:29.0 |
It was actually a general problem with overloading resolution, where the most specific symbol was required to be in a subclass of all other symbols. This does not make sense for mixins. I changed the spec, so that the most specific symbol must now not be in a true superclass of any other alternative. |