I get this error when I try to create an array which contain arrays with enums.
To illustrate better here's the code:
let block1:Form[] = [Form.Circle, Form.Rectangle, Form.Triangle]
let block2:Form[] = [Form.Rectangle, Form.Circle, Form.Triangle]
let block3:Form[] = [Form.Rectangle, Form.Triangle, Form.Circle]
let block4:Form[] = [Form.Circle, Form.Triangle, Form.Rectangle]
let block5:Form[] = [Form.Triangle, Form.Circle, Form.Rectangle]
let block6:Form[] = [Form.Triangle, Form.Rectangle, Form.Circle]
var allBlocks:(Form[][])!
These are the arrays holding the enums and the last one will hold these arrays.
override func didMoveToView(view: SKView) {
allBlocks = [block1, block2, block3, block4, block5, block6] //Error here
...
}
The error occurs when I try to assign the value to allBlocks
If I change the code to this I get no error:
let block1:Form[] = [Form.Circle, Form.Rectangle, Form.Triangle]
let block2:Form[] = [Form.Rectangle, Form.Circle, Form.Triangle]
let block3:Form[] = [Form.Rectangle, Form.Triangle, Form.Circle]
let block4:Form[] = [Form.Circle, Form.Triangle, Form.Rectangle]
let block5:Form[] = [Form.Triangle, Form.Circle, Form.Rectangle]
let block6:Form[] = [Form.Triangle, Form.Rectangle, Form.Circle]
override func didMoveToView(view: SKView) {
var allBlocks = [block1, block2, block3, block4, block5, block6] //No error
...
}
But then I can't access the allBlocks variable in another place.
EDIT: In case it helps