Dear Swift Team!
I have a very simple project. It is Command Line Tool written on Swift 3.0 using Xcode 8.0. This program is:
leta = "a"aaa()
This is working perfectly well and printing "a" in console, but lets do this program more complex:
leta = "a"letb = "b"aaa()
And line print(b)
is marked with error: Use of unresolved identifier 'b'
We can make even easier:
leta = "a"
And again, line print(a)
is marked with error: Use of unresolved identifier 'a'
I am not newbie and I undertand that I can easily fix this error like putting all variables in the beginning of the program. Question is: why is it happening? I thought each file with extension .swift, it is a class and I can put variable and functions, call functions in any order (all variables and constants would be global)... And one last thing, I don't have ability to test this on Swift 2.2, but I don't remember I faced this bug before, so can it be a error of Swift 3.0 compiler? Thank you for any answer!
The text was updated successfully, but these errors were encountered: