Is there an explanation for Xcode's/Swift's treatment of curly braces in var and let statements?

<promise>No, I am not kicking the "inline curly braces versus aligned ones" dead dog.</promise>


In Xcode 7.x, if I start an

if
/
then
block and push the opening curly brace down to the next line (or if I
Alt-[
everything over to column one then
Ctrl-I Re-Indent
), Xcode dutifully obeys what I consider to be one (and my personal choice) of the two standards for placement of the opening brace, to wit:


if (condition)
{
      /blah blah*/
}
else
{
     /yadda yadda*/
}


But... if I do this with var or let, Xcode decides that there needs to be another level of indentation on the open --- but not the close --- brace, to wit:


var x: Int
     {          /* <-- why is this one over this far right? */
     didSet
     {
          / handle it*/
     }
}


Am I missing something? Is there a reason for this, or should I log it as a bug?

Answered by QuinceyMorris in 89714022

When I reported this bug it came back as a duplicate of #21598808, which appears to be open still.

Accepted Answer

When I reported this bug it came back as a duplicate of #21598808, which appears to be open still.

Thanks.

Is there an explanation for Xcode's/Swift's treatment of curly braces in var and let statements?
 
 
Q