title: Value * is not a member of AnyVal
body: <p>This is a fold that I wrote and I get this error:</p>
  
  <pre><code>Error:(26, 42) value * is not a member of AnyVal
          (candE.intersect(candR), massE * massR)
  
                             ^
  </code></pre>
  
  <p><code>allAssignmentsTable</code> is a <code>List[Map[Set[Candidate[A]],Double]]</code></p>
  
  <pre><code>val allAssignmentsTable = hypothesis.map(h =&gt; {
      allAssignments.map(copySet =&gt; {
        if(h.getAssignment.keySet.contains(copySet))
          (copySet -&gt; h.getAssignment(copySet))
        else
          (copySet -&gt; 0.0)
      }).toMap
    })
  
  val aggregated  = allAssignmentsTable.foldLeft(initialFold) { (res,element) =&gt; 
    val allIntersects = element.map { 
      case (candE, massE) =&gt; 
        res.map { 
          case (candR, massR) =&gt; candE.intersect(candR), massE * massR
        }.toList
    }.toList.flatten
  
    val normalizer = allIntersects.groupBy(_._1).filter(_._1.size == 0).map { 
      case(key, value) =&gt; value.foldLeft(0.0)((e,i) =&gt; i._2 + e)
    }.head
  
    allIntersects.groupBy(_._1).map { 
      case(key, value) =&gt; key -&gt; value.foldLeft(0.0)((e,i) =&gt; i._2 + e)
    }
  }
  </code></pre>
  
  <p>if I do this: <code>case(candE, massE:Double)</code> then I won't get an error but I will get exception in match.</p>