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

android - Why am I getting the message 'Youractivity.java is not an activity subclass or alias' -

Making Empty C++ Project: General exception (Exception from HRESULT:0x80131500) Visual Studio Community 2015 -

How to fix java warning for "The value of the local variable is not used " -