class Node {
var successors: Array<Node>
init(_ successors: Array<Node>) {
self.successors = successors
}
}
let a = Node([b])
let b = Node([a])
This innocent piece of code gives an error; error: circular reference it says. The weird thing is that it was repeated 5 times.
.
An attempt to put there weak/unowned didn't do anything. How to get rid of this error?