1
我有下面的類:重載構造錯誤
class Step(kind:TipoStep.Value,
message:String = "",
study:List[Formula] = List(),
lastAdd:Set[Formula] = Set(),
lastDel:Set[Formula] = Set(),
add:List[Formula] = List(),
del:List[Formula] = List()
) {
def this(step:Step,
kind:TipoStep.Value,
message:String = "",
study:List[Formula] = List(),
lastAdd:Set[Formula] = Set(),
lastDel:Set[Formula] = Set()) = this(kind, message, study, lastAdd, lastDel, step.getAllAdd, step.getAllDel)
/* ... */
}
編譯器顯示我folloging錯誤:
error: ambiguous reference to overloaded definition,
both method init$default$5 in object Step of type => scala.collection.mutable.Set[org.lorea.pltl.formula.Formula]
and method init$default$5 in object Step of type => scala.collection.mutable.Set[org.lorea.pltl.formula.Formula]
match expected type scala.collection.mutable.Set[org.lorea.pltl.formula.Formula]
step = new Step(TipoStep.R_fixpoint, s, List(c1, c2), news)
此解決方案不起作用。 – barroco 2010-06-30 08:13:35
@ isola009:你將不得不多說。你有什麼特別的嘗試。造成什麼錯誤? – 2010-06-30 13:00:29