aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/compile/internal/typecheck/subr.go
diff options
context:
space:
mode:
authorDan Scales <danscales@google.com>2021-08-01 20:29:07 -0700
committerDan Scales <danscales@google.com>2021-08-02 17:51:34 +0000
commit156eeb40a6d918bcac82871af1b8e428a5414159 (patch)
treed8c5c6953aa8175cd6fad37b4365816a18a27052 /src/cmd/compile/internal/typecheck/subr.go
parent283991bd7fb5f0004a8d6c27a8b8038e4d448719 (diff)
downloadgo-156eeb40a6d918bcac82871af1b8e428a5414159.tar.gz
go-156eeb40a6d918bcac82871af1b8e428a5414159.zip
[dev.typeparams] cmd/compile: make HasShape() more efficient by implementing with a type flag
Implement HasShape() similar to how HasTParam() is implemented. Fixes #47456 Change-Id: Icbd538574237faad2c4cd8c8e187725a1df47637 Reviewed-on: https://go-review.googlesource.com/c/go/+/339029 Reviewed-by: Keith Randall <khr@golang.org> Trust: Dan Scales <danscales@google.com>
Diffstat (limited to 'src/cmd/compile/internal/typecheck/subr.go')
-rw-r--r--src/cmd/compile/internal/typecheck/subr.go1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/cmd/compile/internal/typecheck/subr.go b/src/cmd/compile/internal/typecheck/subr.go
index 5ee4152e1c..968d7a0d6d 100644
--- a/src/cmd/compile/internal/typecheck/subr.go
+++ b/src/cmd/compile/internal/typecheck/subr.go
@@ -1367,6 +1367,7 @@ func Shapify(t *types.Type) *types.Type {
s := types.NewNamed(name)
s.SetUnderlying(u)
s.SetIsShape(true)
+ s.SetHasShape(true)
name.SetType(s)
name.SetTypecheck(1)
// TODO: add methods to s that the bound has?