% cat x.go
package p
type Buf struct {
s []int
}
var s S
type S struct {
buf Buf
}
// del removes element i from p.s. Its body mentions the parameter p twice.
//
//go:fix inline
func del(p *Buf, i int) {
p.s = append(p.s[:i], p.s[i+1:]...)
}
func (s *S) run() {
// Two inlinable calls in the SAME block, both with the address-of-a-field
// argument &s.buf.
del(&s.buf, 0)
del(&s.buf, 0)
}
% go build x.go
% go fix x.go
% go build x.go
# command-line-arguments
./x.go:25:6: p redeclared in this block
./x.go:23:6: other declaration of p
% cat x.go
package p
type Buf struct {
s []int
}
var s S
type S struct {
buf Buf
}
// del removes element i from p.s. Its body mentions the parameter p twice.
//
//go:fix inline
func del(p *Buf, i int) {
p.s = append(p.s[:i], p.s[i+1:]...)
}
func (s *S) run() {
// Two inlinable calls in the SAME block, both with the address-of-a-field
// argument &s.buf.
var p *Buf = &s.buf
p.s = append(p.s[:0], p.s[0+1:]...)
var p *Buf = &s.buf
p.s = append(p.s[:0], p.s[0+1:]...)
}
/cc @adonovan; tentatively marking release-blocker
/cc @adonovan; tentatively marking release-blocker