IDE: Fire
Version: 9.0.97.2071, 9.1.100.2076
Target: Java
Description:
Bookshelf contains a for loop before super.init call. The compiler will complain when it sees it with: error E155: "self" cannot be accessed before the inherited constructor has been called
public class LabeledShelf {
public var label: String
public init(label: String){
self.label = label
}
}
public class Bookshelf: LabeledShelf {
var books: [String]
init(books: [String], label: String){
//don't seem to like for loops before super.init
for i in 0 ..< 10 {
}
#if COOPER
super.init(label: label)
#endif
self.books = books
#if !COOPER
super.init(label: label)
#endif
}
}