When creating a Map in scala, I call Map(entities.map{e => e.id -> e}), and I get:
Map
Map(entities.map{e => e.id -> e})
found : scala.collection.mutable.Indexed
Try this: Map(entities.map{e => e.id -> e}:_*)
Map(entities.map{e => e.id -> e}:_*)
Explicitly typing it as a varargs using :_* seems to work.
:_*
Or this should work too:
entities.map{e => e.id -> e} toMap