]> Cypherpunks repositories - gostls13.git/commit
go/types: don't panic if targs don't match tparams when substituting
authorRobert Findley <rfindley@google.com>
Wed, 22 Sep 2021 00:20:36 +0000 (20:20 -0400)
committerRobert Findley <rfindley@google.com>
Wed, 22 Sep 2021 13:29:32 +0000 (13:29 +0000)
commit7158ae4e32894cf7050eef287c5e9818b9fb9ce1
tree2b5b1efdfa8ac8c919ff7da2eb11fa6a77e544d8
parent051df0d722fd2ec4473f2ac0ae868a3487927d68
go/types: don't panic if targs don't match tparams when substituting

Invalid code may produce instances where the number of type arguments
does not match the number of type parameters. Such code will cause an
error, but should not cause a panic when substituting in those invalid
instances.

Fixes #48529

Change-Id: Ie5ff5ace55921540a7224cc5022ef9ff7649361a
Reviewed-on: https://go-review.googlesource.com/c/go/+/351337
Trust: Robert Findley <rfindley@google.com>
Run-TryBot: Robert Findley <rfindley@google.com>
Reviewed-by: Robert Griesemer <gri@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
src/go/types/named.go
src/go/types/subst.go
src/go/types/testdata/fixedbugs/issue46461.go2 [new file with mode: 0644]
src/go/types/testdata/fixedbugs/issue48529.go2 [new file with mode: 0644]