[SR-2327] Improve error message when using 'break' inside 'guard' inside 'do' or 'if' #44934
Labels
compiler
The Swift compiler in itself
diagnostics QoI
Bug: Diagnostics Quality of Implementation
good first issue
Good for newcomers
improvement
Additional Detail from JIRA
md5: e84f619c42ea5e8b503c69325237b44f
Issue Description:
With the following code:
The compiler give the not-so-helpful error message:
It would be much clearer to the user what the problem is and how to fix it, if it gave the same error message as it does in this case:
Which is:
The same problem occurs with if statements. For example, "if (true) { guard 1 == 2 else { break } }" gives the unhelpful message but "if (true) { break }" gives the helpful one.
The text was updated successfully, but these errors were encountered: