title: Scala error: Found List[Char], required List[ScalaObject]
body: <p>I have this snippet of Scala code:</p>
  
  <pre><code>def prologList(l: List[ScalaObject], sep: String) =
      "[" + (if (l isEmpty) "" else l.reduceLeft(_ + sep + _)) + "]"
  
  def neighbors(s: State) = prologList(trans(s).toList, ", ")
  def labels(s: State) = prologList(labeling(s).toList, ", ")
  </code></pre>
  
  <p>The next-to-last line compiles fine, but on the last line I get the error</p>
  
  <blockquote>
    <p>Found <code>List[Char]</code>, required <code>List[ScalaObject]</code></p>
  </blockquote>
  
  <p>(<code>labeling</code> has the type <code>Map[State, Set[Char]]</code>.)</p>
  
  <p>I'm a bit surprised, since 1) I thought that <code>List[Char]</code> could be seen as a subtype of <code>List[ScalaObject]</code> (as opposed to Java), and 2) the line above the last line compiles! (<code>trans</code> has type <code>Map[State, Set[State]]</code> though...)</p>
  
  <p>The question is obvious, what am I doing wrong, and how do I fix it?</p>