This is not a code-level question, per se, but a question about false code error messages. I would have posted on Apple's developer forums, but the registration page is currently broken.
I'm using Xcode 9.3 on macOS 10.13.4 on a Mac Mini with 16 GB of RAM. I frequently get false code error messages even when my code is fine. The false errors are usually
Expected ']' and similar. Please see the examples below:
An example of a false error:
Now I retype the same line exactly, and the false error goes away:
As you can see, as soon as I retype the same exact code below the 'offending' line, that new line of code doesn't show an error. As seen in the examples, I have enabled the display of 'invisible' characters to see if maybe some unprintable character was causing a problem, but I don't see anything like that.
Something fishy is going on here. Am I missing something or is this a bug I need to report?