I have the following code:
let FOO = true
if (FOO) {
let BAR = "Off"
} else {
let BAR = "On"
}
print(BAR)
My problem that is the line that says print(BAR)
returns the error:
Use of unresolved identifier 'BAR'
From what I can see, there is no reason that this code shouldn't compile is there? The constant BAR
will always be created so can always be printed to the console.
Aucun commentaire:
Enregistrer un commentaire