[SR-14836] Improve diagnostic on missing 'do' before brace #57183
Labels
bug
A deviation from expected or documented behavior. Also: expected but undesirable behavior.
compiler
The Swift compiler in itself
diagnostics QoI
Bug: Diagnostics Quality of Implementation
good first issue
Good for newcomers
parser
Area → compiler: The legacy C++ parser
Additional Detail from JIRA
md5: 9992a54fd0fa4a7f3c669b06dd3c6b39
Issue Description:
Coming from C-based languages, one can potentially forget that
do
is explicitly needed in Swift.This gives a bunch of not-so-useful errors on main
Perhaps we should have some heuristics (maybe check the column numbers of the
let
/var
and compare it with the column number for the opening brace) to detect this situation and pinpoint the problem more clearly, suggesting that you add ado
with a fix-it.The text was updated successfully, but these errors were encountered: