From b55cc6687d8f805663e9e803ad5293d1b399ce37 Mon Sep 17 00:00:00 2001 From: Cuong Manh Le Date: Wed, 23 Jun 2021 23:56:01 +0700 Subject: [dev.typeparams] cmd/compile: use r.hasTypeParams in typIdx CL 329571 fold the checking has type params logic, but did not realize that the instance in typIdx can be folded, too. Change-Id: I4682af3779535af6a6e843972cada12ba1bae6ae Reviewed-on: https://go-review.googlesource.com/c/go/+/330389 Trust: Cuong Manh Le Run-TryBot: Cuong Manh Le TryBot-Result: Go Bot Reviewed-by: Matthew Dempsky --- src/cmd/compile/internal/noder/reader.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/cmd/compile/internal/noder/reader.go') diff --git a/src/cmd/compile/internal/noder/reader.go b/src/cmd/compile/internal/noder/reader.go index df9dccc156..d2fe575ffd 100644 --- a/src/cmd/compile/internal/noder/reader.go +++ b/src/cmd/compile/internal/noder/reader.go @@ -345,7 +345,7 @@ func (pr *pkgReader) typIdx(idx int, implicits, explicits []*types.Type) *types. // TODO(mdempsky): If we're clever, we should be able to still cache // types by tracking which type parameters are used. However, in my // attempts so far, I haven't yet succeeded in being clever enough. - if len(implicits)+len(explicits) == 0 { + if !r.hasTypeParams() { pr.typs[idx] = typ } -- cgit v1.2.3-54-g00ecf