From bcb3927cb51af39f44d810aab809dff27c950697 Mon Sep 17 00:00:00 2001 From: Keith Randall Date: Fri, 4 Jun 2021 23:01:13 -0700 Subject: [dev.typeparams] cmd/compile: introduce IsTypeParam() helper better than Kind() == types.TTYPEPARAM Change-Id: I4f35a177cd0cda3be615a92b7b2af1b5a60a3bbc Reviewed-on: https://go-review.googlesource.com/c/go/+/325410 Trust: Keith Randall Trust: Dan Scales Run-TryBot: Keith Randall TryBot-Result: Go Bot Reviewed-by: Dan Scales --- src/cmd/compile/internal/noder/helpers.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/cmd/compile/internal/noder') diff --git a/src/cmd/compile/internal/noder/helpers.go b/src/cmd/compile/internal/noder/helpers.go index ea30a3bfa9..456df312a6 100644 --- a/src/cmd/compile/internal/noder/helpers.go +++ b/src/cmd/compile/internal/noder/helpers.go @@ -63,7 +63,7 @@ func FixValue(typ *types.Type, val constant.Value) constant.Value { if !typ.IsUntyped() { val = typecheck.DefaultLit(ir.NewBasicLit(src.NoXPos, val), typ).Val() } - if typ.Kind() != types.TTYPEPARAM { + if !typ.IsTypeParam() { ir.AssertValidTypeForConst(typ, val) } return val -- cgit v1.3-5-g9baa