1
0
mirror of https://github.com/golang/go synced 2024-11-05 23:26:18 -07:00
go/test/fixedbugs/issue52128.dir/b.go
Cuong Manh Le a8780f94c3 [dev.unified] cmd/compile: fix missing method value wrapper in unified IR
Unified IR uses to generate wrappers after the global inlining pass, so
it needs to apply inlining for the wrappers itself. However, inlining
may reveal new method value nodes which have not been seen yet, thus
unified IR never generates wrappers for them.

To fix it, just visiting the wrapper function body once more time after
inlining, and generate wrappers for any new method value nodes.

Fixes #52128

Change-Id: I78631c4faa0b00357d4f84704d3525fd38a52cd7
Reviewed-on: https://go-review.googlesource.com/c/go/+/410344
Run-TryBot: Cuong Manh Le <cuong.manhle.vn@gmail.com>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Cherry Mui <cherryyz@google.com>
2022-06-06 19:20:41 +00:00

18 lines
278 B
Go

// Copyright 2022 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 b
import (
"./a"
)
type S struct{}
func (s *S) M1() a.I {
return a.NewWithF(s.M2)
}
func (s *S) M2() {}