daniellansun commented on PR #2023: URL: https://github.com/apache/groovy/pull/2023#issuecomment-1875821378
We can add a option to prevent or warn dead code or disable check totally. Here is the table to show how mainstream programming language to handle dead code. Most of them prevent or warn the dead code, so I think it's good choice for Groovy to align with most of them. | Language | Allows Consecutive `return` (Dead Code) | Compiler/Interpreter Behavior | |----------|---------------------------------------|-------------------------------| | Java | No | Marks as unreachable code, may cause a compile error. | | C++ | Yes | Might warn but allows compilation. | | C# | No | Identifies unreachable code, causes a compile error. | | Python | Yes | Does not prevent dead code, allows execution. | | Scala | Yes | Might issue a warning but allows compilation. | | Kotlin | No | Detects unreachable code, causes a compile error. | | JavaScript | Yes | Does not check for dead code at compile time. | -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
