cmd/compile: use f.Nname.Type() in makeABIWrapper

Apparently, f.Nname.Ntype.Type() doesn't work with types2, as it
doesn't set Ntype, unlike the old type checker. f.Nname.Type()
works for both.

Change-Id: I6fa8a81c9fc7b65e008d9f158b88f0d56d84c3ff
Reviewed-on: https://go-review.googlesource.com/c/go/+/312089
Trust: Cherry Zhang <cherryyz@google.com>
Run-TryBot: Cherry Zhang <cherryyz@google.com>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
This commit is contained in:
Cherry Zhang 2021-04-20 17:29:57 -04:00
parent 57b0d838ed
commit f448cb8ba8

View file

@ -311,7 +311,7 @@ func makeABIWrapper(f *ir.Func, wrapperABI obj.ABI) {
// At the moment we don't support wrapping a method, we'd need machinery
// below to handle the receiver. Panic if we see this scenario.
ft := f.Nname.Ntype.Type()
ft := f.Nname.Type()
if ft.NumRecvs() != 0 {
panic("makeABIWrapper support for wrapping methods not implemented")
}