]> Cypherpunks.ru repositories - gostls13.git/blobdiff - src/cmd/compile/internal/walk/expr.go
cmd/compile: redo IsRuntimePkg/IsReflectPkg predicate
[gostls13.git] / src / cmd / compile / internal / walk / expr.go
index 85a6d1fc33dea046502cc1e3d0daa505723f3e4a..4b83773932562fdfd34217cc7201368429dbe2db 100644 (file)
@@ -993,7 +993,7 @@ func usemethod(n *ir.CallExpr) {
 
        // Check that first result type is "reflect.Method". Note that we have to check sym name and sym package
        // separately, as we can't check for exact string "reflect.Method" reliably (e.g., see #19028 and #38515).
-       if s := t.Result(0).Type.Sym(); s != nil && s.Name == "Method" && types.IsReflectPkg(s.Pkg) {
+       if s := t.Result(0).Type.Sym(); s != nil && types.ReflectSymName(s) == "Method" {
                ir.CurFunc.SetReflectMethod(true)
                // The LSym is initialized at this point. We need to set the attribute on the LSym.
                ir.CurFunc.LSym.Set(obj.AttrReflectMethod, true)