自昨天起,我阻止了有关类型不匹配错误的信息,但我看不到如何更正它。也许你可以帮助我。Scala中的类型不匹配错误
def combine(head : (Char,Int), xs : Occurrences) : List[Occurrences] =
xs.map { case (x,i) => for (occu <- 1 to head._2) yield List((x,i), (head._1, occu)) }
这里是我的错误:
type mismatch;
found : List[scala.collection.immutable.IndexedSeq[List[(Char, Int)]]]
required: List[forcomp.Anagrams.Occurrences]
我怎样才能解决这个错误类型Occurrences
被定义为type Occurrences = List[(Char, Int)]
?
别担心,根据你的回答,我终于找到了解决办法。谢谢 – Dimitri 2013-05-09 14:01:44
很高兴听到它! – coltfred 2013-05-09 16:03:32