0

In beta 5 this code works perfectly, but it doesn't compile in Beta 6. Any ideas why?

struct GenericGenerator<T>: GeneratorType {
    var items: [T]
    mutating func next() -> T? {
        return items.isEmpty ? .None : items.removeAtIndex(0)
    }
}

class ExerciseContainer : SequenceType {

    var exercises: [Exercise] = []

    func generate() -> GenericGenerator<Exercise> {
        return GenericGenerator(items: self.exercises)
    }
}

enter image description here

Eli Bendersky
  • 263,248
  • 89
  • 350
  • 412
Konrad77
  • 2,515
  • 1
  • 19
  • 36
  • possible duplicate of [Suddenly getting compiler crash "arrayForceCast" in Swift XCode beta 6](http://stackoverflow.com/questions/25373437/suddenly-getting-compiler-crash-arrayforcecast-in-swift-xcode-beta-6) – pNre Aug 20 '14 at 06:09
  • CMD+OPT+SHIFT+K "Clean Build Folder" - helped. Thanks – Konrad77 Aug 20 '14 at 06:13

0 Answers0