This error will only generate when you try to add different value to the same variable. Check if you have already assigned any value to the variable 'b'. If you use:
scala> val b = 10
then you try to assign another value to b, then it will give you this error because "val" is a constant it is not going to bearable anymore. If you define something as "val" it will not update that value.
Hope you understand the factor.