Details
-
Type:
Bug
-
Status: Open
-
Priority:
Medium
-
Resolution: Unresolved
-
Component/s: Compiler
-
Labels:
-
Radar URL:
Description
Given var a = 1, b = 2, in some other languages you can swap them with
a, b = b, a
In Swift, parens are required:
(a, b) = (b, a)
If you forget the parens, though, the errors aren't very helpful:
Consecutive statements on a line must be separated by ';' Expected expression a, b = b, a ~ ;
It'd be nice to recognize this and suggest adding parentheses.