ID:2145154
 
Applies to:DM Language
Status: Open

Issue hasn't been assigned a status value.
I'd like if code that cannot be executed due to being after a break, continue, or return to throw a compiler warning.

Examples
/datum/proc/hello()
world << "hello world"
return
world << "goodbye world"


/datum/proc/hello()
for(x in y)
if(x.something)
continue
do_something()


Since break, continue, and return are all guaranteed to stop a part of a function with certain scope, I believe this should be feasible with the parser to search for code that would be executing after it and otherwise throw a compiler warning.

I ask this because I have seen and ran into bugged code (recently) where the only issue was an extra/missing tab being added in the wrong area leading to code that wouldn't be executed. And there wouldn't be any reason you would want your code to have these sections anyway since they would never be executed.
Unreachable code is a commonly outputted error, it'd be nice to have it here too.