You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fn main():
var a = Int(0)
var b: Int
b = a^ # xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
is auto-formatted as:
fn main():
var a = Int(0)
var b: Int
b = (
a^
) # xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Whereas if the ^ sigil is removed, or if the initialization is done on the same line as the declaration (var b = a^), the auto-formatter doesn't intervene.
Ideally, in all cases, the formatter will just leave the code alone, because splitting it over multiple lines doesn't aid readability.
This issue isn't specific to the ^ sigil. It also occurs with lines like b = +a and b = a + 1.
System information
MacOS Ventura
Mojo nightly 2024.5.622 (d9dc4c21)
The text was updated successfully, but these errors were encountered:
Bug description
The following program:
is auto-formatted as:
Whereas if the
^
sigil is removed, or if the initialization is done on the same line as the declaration (var b = a^
), the auto-formatter doesn't intervene.Ideally, in all cases, the formatter will just leave the code alone, because splitting it over multiple lines doesn't aid readability.
This issue isn't specific to the
^
sigil. It also occurs with lines likeb = +a
andb = a + 1
.System information
The text was updated successfully, but these errors were encountered: