When using odinfmt to format a file that contains a switch expression, the trailing semicolon is removed which causes a syntax error. This is with ols and odinfmt as of aef651f5.
// Working example before odinfmt
package main
main :: proc() {
items: []string = []string{"Hellope!"}
for i := 0; i < len(items); i += 1 {
switch item := items[i]; {
case "Hellope!":
break
}
}
}
// Error example after odinfmt
package main
main :: proc() {
items: []string = []string{"Hellope!"}
for i := 0; i < len(items); i += 1 {
// Syntax Error: Expected 'switch expression', found a simple statement.
switch item := items[i] {
case "Hellope!":
break
}
}
}
When using
odinfmt
to format a file that contains a switch expression, the trailing semicolon is removed which causes a syntax error. This is withols
andodinfmt
as of aef651f5.