我从昨天起因类型不匹配错误而被阻止,我不知道如何纠正它。也许你可以帮助我。
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)]
我该如何解决这个错误?