title: Scala type mismatch problem (expected Map, found scala.collection.mutable.HashMap)
body: <p>I am still a newbie Scala programmer, so sorry if this question may look naive, but I searched for a while and found no solutions. I am using Scala 2.8, and I have a class PXGivenZ defined as:</p>
  
  <pre><code>class PXGivenZ (val x:Int, val z:Seq[Int], val values: Map[Seq[Int], Map[Int, Double]] ){...}
  </code></pre>
  
  <p>When I try to instantiate an element of that class into another block of program like this:</p>
  
  <pre><code>// x is an Int
  // z is a LinkedList of Int
  ...
  var zMap = new HashMap[Seq[Int], HashMap[Int, Double]]
  ...
  val pxgivenz = new PXGivenZ(x, z, zMap)
  </code></pre>
  
  <p>I get the following error:</p>
  
  <pre><code>found   : scala.collection.mutable.HashMap[Seq[Int],scala.collection.mutable.HashMap[Int,Double]]
   required: Map[Seq[Int],Map[Int,Double]]
             val pxgivenz = new PXGivenZ(x, z, zMap) 
                                               ^
  </code></pre>
  
  <p>There is clearly something I don't get: how is a Map[Seq[Int],Map[Int,Double]] different from a HashMap[Seq[Int], HashMap[Int,Double]]? Or is something wrong with the "mutable" classes?</p>
  
  <p>Thanks in advance to anyone who will help me!</p>