Fixes -G=3 issue with issue44688.go.
Change-Id: Ie98c0cbd48683dedd115332043f14c8f3160f46c
Reviewed-on: https://go-review.googlesource.com/c/go/+/337029
Run-TryBot: Dan Scales <danscales@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
Trust: Dan Scales <danscales@google.com>
if n.Op() == ir.OXDOT {
n = typecheck.AddImplicitDots(n)
n.SetOp(ir.ODOT)
+
+ // Set the Selection field and typecheck flag for any new ODOT nodes
+ // added by AddImplicitDots(), and also transform to ODOTPTR if
+ // needed. Equivalent to 'n.X = typecheck(n.X, ctxExpr|ctxType)' in
+ // tcDot.
+ for n1 := n; n1.X.Op() == ir.ODOT; {
+ n1 = n1.X.(*ir.SelectorExpr)
+ if !n1.Implicit() {
+ break
+ }
+ t1 := n1.X.Type()
+ if t1.IsPtr() && !t1.Elem().IsInterface() {
+ t1 = t1.Elem()
+ n1.SetOp(ir.ODOTPTR)
+ }
+ typecheck.Lookdot(n1, t1, 0)
+ n1.SetTypecheck(1)
+ }
}
t := n.X.Type()
"typeparam/mdempsky/4.go", // -G=3 can't export functions with labeled breaks in loops
"typeparam/mdempsky/13.go", // problem with interface as as a type arg.
- "typeparam/cons.go", // causes an unreachable method
- "typeparam/issue44688.go", // interface conversion fails due to missing method
+ "typeparam/cons.go", // causes an unreachable method
)
var unifiedFailures = setOf(