Im new to Xcode getting this error in this playground, can someone help me here... This was In a playground btw Thanks,
struct Digit {
var number : Int
init(_ n: Int){
self.number = n
}
mutating func changeNumberTo(_ n:Int) {
self.number = n
}
func otherFunction(_ f: ()->()) {
}
mutating func callAnotherFunction() {
otherFunction {
self.changeNumberTo(345) // *
}
}
}
var d = Digit(123) // Digit is a struct
print(d.number) //123
var d2 = d //Assignment!
d2.number = 42
print(d.number)
enum Node {
case none(Int)
indirect case left(Int, Node)
indirect case right(Int, Node)
indirect case both(Int, Node, Node)
}