mirror of
https://github.com/golang/go
synced 2024-11-02 13:42:29 +00:00
cmd/compile: only check implicit dots for method call enabled by a type bound
Fixes #53419 Change-Id: Ibad64f5c4af2112deeb0a9ecc9c589b17594bd05 Reviewed-on: https://go-review.googlesource.com/c/go/+/414836 Reviewed-by: Matthew Dempsky <mdempsky@google.com> Reviewed-by: David Chase <drchase@google.com> Reviewed-by: Keith Randall <khr@golang.org> TryBot-Result: Gopher Robot <gobot@golang.org> Run-TryBot: Cuong Manh Le <cuong.manhle.vn@gmail.com>
This commit is contained in:
parent
c391156f96
commit
1243ec9c17
2 changed files with 8 additions and 7 deletions
|
@ -1654,12 +1654,14 @@ func (g *genInst) getDictionarySym(gf *ir.Name, targs []*types.Type, isMeth bool
|
|||
se := call.X.(*ir.SelectorExpr)
|
||||
if se.X.Type().IsShape() {
|
||||
// This is a method call enabled by a type bound.
|
||||
|
||||
// We need this extra check for method expressions,
|
||||
// which don't add in the implicit XDOTs.
|
||||
tmpse := ir.NewSelectorExpr(src.NoXPos, ir.OXDOT, se.X, se.Sel)
|
||||
tmpse = typecheck.AddImplicitDots(tmpse)
|
||||
tparam := tmpse.X.Type()
|
||||
tparam := se.X.Type()
|
||||
if call.X.Op() == ir.ODOTMETH {
|
||||
// We need this extra check for method expressions,
|
||||
// which don't add in the implicit XDOTs.
|
||||
tmpse := ir.NewSelectorExpr(src.NoXPos, ir.OXDOT, se.X, se.Sel)
|
||||
tmpse = typecheck.AddImplicitDots(tmpse)
|
||||
tparam = tmpse.X.Type()
|
||||
}
|
||||
if !tparam.IsShape() {
|
||||
// The method expression is not
|
||||
// really on a typeparam.
|
||||
|
|
|
@ -1966,7 +1966,6 @@ var types2Failures32Bit = setOf(
|
|||
var go118Failures = setOf(
|
||||
"typeparam/nested.go", // 1.18 compiler doesn't support function-local types with generics
|
||||
"typeparam/issue51521.go", // 1.18 compiler produces bad panic message and link error
|
||||
"typeparam/issue53419.go", // 1.18 compiler mishandles generic selector resolution
|
||||
)
|
||||
|
||||
// In all of these cases, the 1.17 compiler reports reasonable errors, but either the
|
||||
|
|
Loading…
Reference in a new issue