[SR-9732] Incorrect/Misleading warning for var/let in for loop #52166
Labels
compiler
The Swift compiler in itself
diagnostics QoI
Bug: Diagnostics Quality of Implementation
improvement
Additional Detail from JIRA
md5: 20c35c888922c9134ae2df77a55a7779
Issue Description:
Tested using LLVM f63b283c71, Clang 41ac4c4262, Swift 7cb2c9b:
The correct solution would be to remove the "var" (which is what Xcode's Fix-It does).
Following the advice results in:
This does not happen in REPL.
(For reference: see my Swift Forum post)
Suggested fixes:
Change the warning to "... consider removing 'var'" or
allow "let".
Trivia:
I started with the let variant, the error message was not very helpful.
The text was updated successfully, but these errors were encountered: