How can I clear the swift warning "will never be excuted"? -


now learning swift , when use if - else ,the xcode shows me warniing "will not excuted".though isn't big problem, don't want see this, how can clear warning in project?

this logic error compiler has picked , warning about.

it gives line number in code can never reached.

a) change logic of code

b) delete or comment out lines of code can never reached

the compiler not give message unnecessarily

example

if 1 == 2 {   = 3 }  else {   = 4 } 

obviously condition never met, a=3 assignment can never happen.


Comments

Popular posts from this blog

sql - VB.NET Operand type clash: date is incompatible with int error -

SVG stroke-linecap doesn't work for circles in Firefox? -

python - TypeError: Scalar value for argument 'color' is not numeric in openCV -