Stack Exchange
Value * is not a member of AnyVal
This is a fold that I wrote and I get this error:
Error:(26, 42) value * is not a member of AnyVal
        (candE.intersect(candR), massE * massR)

                           ^

allAssignmentsTable is a List[Map[Set[Candidate[A]],Double]]
val allAssignmentsTable = hypothesis.map(h => {
    allAssignments.map(copySet => {
      if(h.getAssignment.keySet.contains(copySet))
        (copySet -> h.getAssignment(copySet))
      else
        (copySet -> 0.0)
    }).toMap
  })

val aggregated  = allAssignmentsTable.foldLeft(initialFold) { (res,element) => 
  val allIntersects = element.map { 
    case (candE, massE) => 
      res.map { 
        case (candR, massR) => candE.intersect(candR), massE * massR
      }.toList
  }.toList.flatten

  val normalizer = allIntersects.groupBy(_._1).filter(_._1.size == 0).map { 
    case(key, value) => value.foldLeft(0.0)((e,i) => i._2 + e)
  }.head

  allIntersects.groupBy(_._1).map { 
    case(key, value) => key -> value.foldLeft(0.0)((e,i) => i._2 + e)
  }
}

if I do this: case(candE, massE:Double) then I won't get an error but I will get exception in match.

your code is missing 2 } you have 6 { but only 4 }, without those last two it's hard to determine where exactly your blocks end

what's the type of element?

element is Map[Set[Candidate[A]],Double]

add some code that describes how this collection is created.

If it cannot match this case, then apparently whatever gets into the match, is not (Candidate[A],Double) tuple. Add a catch-all case x:_ => print(x)  (or logger.debug(x) if you use logger) to see what you are getting.

@Ashalynd It needs a big background of my code to show that ... but I am using IDE and it tells me that the what types are.

By the way, in tuple (26, 42) the second element doesn't look like Double.

That's why I am convinced that beginners should not use anything more complex than Sublime, but that's my personal opinion :)

@Ashalynd Being a beginner in StackOverFlow doesn't entail "being beginner in programming"
I am beginner in Scala anyways ;)

That's exactly what I meant :) IDE's can be deceiving. From your error it looks like the element in the matching has the wrong type, that much is clear. Do catch-all and see what you get.

@Ashalynd I added some additional code

Do a little experiment: specify the type of allAssignmentsTable explicitly: val allAssignmentsTable:Map[Set[Candidate[A]],Double] =... - does the compiler eat that?

The problem that you get here:
val aggregated  = allAssignmentsTable.foldLeft(initialFold) { (res,element) => 
  val allIntersects = element.map { 
    case (candE, massE) => 
      res.map { 
        case (candR, massR) => candE.intersect(candR), massE * massR
      }.toList
  }.toList.flatten

is most probably arising from the previous code block:
val allAssignmentsTable = hypothesis.map(h => {
    allAssignments.map(copySet => {
      if(h.getAssignment.keySet.contains(copySet))
        (copySet -> h.getAssignment(copySet))
      else
        (copySet -> 0.0)
    }).toMap
  })

My hypothesis is that h.getAssignment(copySet) returns something else instead of Double (which seems to be confirmed by the error message quoted in the OP - (26, 42)etc, neither of these two values look like it is a Double. Therefore, allAssignmentsTable undercover is probably not List[Map[Set[Candidate[A]],Double]] but something else e.g. it has Any instead of Double, therefore operator * cannot be applied.

Thanks, I found it! Somewhere I had a Int output 0 instead of 0.0, It is crazy that IntelliJ infer the types in other way that compiler does!

Good that you've found it, have fun with Scala :)
