I have this card that looks like this:
val fields: Map[(Int, Int), Field]
and I thought about doing something like:
val fields: Map[(Int, Int), Field] = Map( for(a <- 0 to 10) { (0, a) -> new Field(this, 0, a) } )
instead of a long copy / paste list, for example:
(0, 0) -> new Field(this, 0, 0), (1, 0) -> new Field(this, 1, 0), (2, 0) -> new Field(this, 2, 0), (3, 0) -> new Field(this, 3, 0), (4, 0) -> new Field(this, 4, 0), (5, 0) -> new Field(this, 5, 0), (6, 0) -> new Field(this, 6, 0), (7, 0) -> new Field(this, 7, 0), (8, 0) -> new Field(this, 8, 0), (0, 1) -> new Field(this, 0, 1), ...
But I get
Type mismatch expected: (NotInferedA, NotInferedB), actual: Unit
Why is it and how can I overcome it?