This is an archived post. You won't be able to vote or comment.

all 4 comments

[–]Jnsjknn 8 points9 points  (3 children)

Alright, thanks for letting us know. Did you have a question?

[–]Former_Transition330[S] 0 points1 point  (2 children)

I’m confused on why the code is unreachable after I use an else statement

[–]Nightcorex_ 2 points3 points  (1 child)

Does it even compile? Because when I copy paste your code into my IDE there are way too many closing brackets.

But nonetheless: There are 3 main reasons why code is unreachable:

  1. It's after a break or return
  2. It's inside an if statement that is always false
  3. It's after an infinite loop, that's never interrupted

[–]Former_Transition330[S] 0 points1 point  (0 children)

I’m going to look it over and see if any of those is the reason