i try create map different map inside
val mymap = map("name"->"somename",map(1->2))
i got compiler:
scala: type mismatch; found : scala.collection.immutable.map[int,int] required: (?, ?) val mymap = map("name"->"somename",map(1->2)) ^
why expect work? you've provided key without value:
val key = map(1->2) val mymap = map("name"->"somename", key)
perhaps wanted combine 2 maps? can done with:
val mymap = map("name"->"somename") ++ map(1->2) // scala.collection.immutable.map[any,any] = map(name -> somename, 1 -> 2)
Comments
Post a Comment