In Swift 3 I have two variables declared like this:
let patternArray = [true,true,false,true,true,false,true,true]
var resultArray = [Bool]()
Later in my code I have this, to get part of the array:
resultArray = patternArray [0..<4]
Whe compliling I get this error message:
Cannot subscript a value of type '[Bool]' with an index of type 'CountableRange<Int>'
I have no idea why. Am I making some obvious mistake?
I am using Xcode Version 8.3.2.
Moreover I have checked that this kind of syntax works in Playground.