The optimization in unary operaror bypasses the necessary temporary variable in that case and must be disabled. Fixes #1181.
11 lines
93 B
Go
11 lines
93 B
Go
package main
|
|
|
|
func main() {
|
|
a, b := 1, 2
|
|
a, b = b, -a
|
|
println(a, b)
|
|
}
|
|
|
|
// Output:
|
|
// 2 -1
|