case ir.OXDOT:
// This is the case of a bound call on a typeparam,
// which will be handled in the dictPass.
+ // As with OFUNCINST, we must transform the arguments of the call now,
+ // so any needed CONVIFACE nodes are exposed.
+ transformEarlyCall(call)
case ir.ODOTTYPE, ir.ODOTTYPE2:
// These are DOTTYPEs that could get transformed into
transformDot(mse, false)
}
case ir.OCALL:
- op := m.(*ir.CallExpr).X.Op()
+ call := m.(*ir.CallExpr)
+ op := call.X.Op()
if op == ir.OMETHVALUE {
// Redo the transformation of OXDOT, now that we
// know the method value is being called.
- m.(*ir.CallExpr).X.(*ir.SelectorExpr).SetOp(ir.OXDOT)
- transformDot(m.(*ir.CallExpr).X.(*ir.SelectorExpr), true)
+ call.X.(*ir.SelectorExpr).SetOp(ir.OXDOT)
+ transformDot(call.X.(*ir.SelectorExpr), true)
}
- transformCall(m.(*ir.CallExpr))
+ transformCall(call)
case ir.OCONVIFACE:
if m.Type().IsEmptyInterface() && m.(*ir.ConvExpr).X.Type().IsEmptyInterface() {
--- /dev/null
+// compile -G=3
+
+// Copyright 2021 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 p
+
+type I interface {
+ M(interface{})
+}
+
+type a[T any] struct{}
+
+func (a[T]) M(interface{}) {}
+
+func f[T I](t *T) {
+ (*t).M(t)
+}
+
+func g() {
+ f(&a[int]{})
+}