Hello,
I get a compiler warning at line 02 : Variable 'i' was never used; consider replacing with '_' or removing it
func test01 () {
var i: Int
for i in 1...10 {
print (i)
}
}
Why does the compiler consider that my variable "i" is never used, it is used at line 3 and 4 ?
If I remove the line 2 "var i: Int", the compiler is satisfied but not me.
I am an experimented programmer but new to swift.
I use to always declare my variable, and I expect the compiler to inform me if I use an undeclared variable to avoid typo in my coding.
Subsidiary question, where can I find in the documentation the meaning of compiler warnings or errors ?
I tried secondary click on warning --> Show Quick Help but got no results 😟
Thanks for your help.
M1ch3l