Reputation: 636
From time to time i get this error and Its no problem to fix, but I wanna learn how to prevent this:
this code gives error:
if let predecessor = myTree.getNode(withValue: 7)?.predecessor()?.key {
print("Predecessor to 7 should be 5: ", predecessor)
}
the error is the space after "key"
But if i replace with with a new space:
if let predecessor = myTree.getNode(withValue: 7)?.predecessor()?.key {
print("Predecessor to 7 should be 5: ", predecessor)
}
it runs just fine. Does anyone know what gives?
Upvotes: 1
Views: 74
Reputation: 636
Solution is to try to avoid holding alt while pressing the spacebar :)
Upvotes: 1