Clarification on unreachable panic statement #1292
Labels
Area/Lang
Relates to the Ballerina language specification
Type/Improvement
Enhancement to language design
Description:
Consider the below scenario, where there's an unreachable
panic error("")
statement followed by a variable assignment. Shouldn't we suggest theunreachable code
error for the panic statement? Currently, if there's another statement, such as a variable assignment, after the panic statement, we are suggesting theunreachable code
error for the variable assignment.The spec says,
It is a compile error if a statement other than a panic-stmt is not reachable.
Is there a reason for not suggesting the
unreachable code
error for panic statements?Suggested Labels:
Code sample that shows issue:
Related Issues: ballerina-platform/ballerina-lang#42105
The text was updated successfully, but these errors were encountered: