1
0
mirror of https://github.com/golang/go synced 2024-11-24 12:30:14 -07:00
go/test/fixedbugs/issue17596.go
Keith Randall a047b6bf7d cmd/compile: emit assignments after calls in the right order
Fixes a bug where assignments that should come after a call
were instead being issued before the call.

Fixes #17596
Fixes #17618

Change-Id: Ic9ae4c34ae38fc4ccd0604b65345b05896a2c295
Reviewed-on: https://go-review.googlesource.com/32226
Run-TryBot: Keith Randall <khr@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
2016-10-27 16:52:30 +00:00

20 lines
314 B
Go

// compile
// Copyright 2016 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package foo
type T interface {
foo()
}
func f() (T, int)
func g(v interface{}) (interface{}, int) {
var x int
v, x = f()
return v, x
}