Function declarations hide unreachable code
See original GitHub issueUnreachable 'var' after 'return'.
on the following:
function main() {
return 'Hello, World!';
var foo = 'foo';
}
main();
but no error on this:
function main() {
return 'Hello, World: ' + bar();
function bar() {
console.log(foo);
}
var foo = 'foo';
}
main();
Issue Analytics
- State:
- Created 8 years ago
- Comments:7 (4 by maintainers)
Top Results From Across the Web
Remove unreachable code refactoring - Visual Studio ...
Right-click the code, select the Quick Actions and Refactorings menu and select Remove unreachable code from the Preview window popup. When you' ...
Read more >c# - Is there a way to get VS2008 to stop warning me about ...
But I am tired of seeing warnings about unreachable code. I'm a person that likes to eliminate all of the warnings, but I...
Read more >Disabling unreachable code detection partially for the ... - GitHub
I want to disable the unreachable code detection for the condition completeness check. function f(n) { switch(n) { case 0: return 0; ...
Read more >Warning: unreachable code after return statement - JavaScript
When an expression exists after a valid return statement, a warning is given to indicate that the code after the return statement is...
Read more >C++/CLI: false positive C4702 unreachable code warning ...
Developer Community · declare a ref class with a member variable that is a native pointer. · define a member function of that...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
This bug was recently reported in different terms, so I’m renaming this issue to make it easier for folks to find.
Oh, wow – this has been open for 3 years. Is it going to be as hard to fix now as then, or have refactors since 2015 made things easier?