cmd/compile/internal/noder: set hasShape for shaped functions

A signature with a shape will be overwritten using shapeSig, but it
arguably still has a shape because it's using a shaped dictionary.
This mimics the approach for ObjType.

Change-Id: I4646cd73129606772a9218662de76a37217366b4
Reviewed-on: https://go-review.googlesource.com/c/go/+/759721
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Robert Griesemer <gri@google.com>
diff --git a/src/cmd/compile/internal/noder/reader.go b/src/cmd/compile/internal/noder/reader.go
index fb5a099..e4f2a39 100644
--- a/src/cmd/compile/internal/noder/reader.go
+++ b/src/cmd/compile/internal/noder/reader.go
@@ -792,6 +792,10 @@
 		fpos := r.pos()
 
 		fn := ir.NewFunc(fpos, npos, sym, typ)
+		if r.hasTypeParams() && r.dict.shaped {
+			typ.SetHasShape(true)
+		}
+
 		name := fn.Nname
 		if !sym.IsBlank() {
 			if sym.Def != nil {