aboutsummaryrefslogtreecommitdiff
path: root/src/encoding
diff options
context:
space:
mode:
authorDan Scales <danscales@google.com>2021-09-06 16:25:43 -0700
committerDan Scales <danscales@google.com>2021-09-07 20:37:05 +0000
commit80783558b06741beaf41dbd198013fe3a13c9ad2 (patch)
tree5a2b8582afba8399f5df09c5b93818244870808f /src/encoding
parent23f4f0db682fad0c8d61a5b5cdbdbad4cf1cd41f (diff)
downloadgo-80783558b06741beaf41dbd198013fe3a13c9ad2.tar.xz
cmd/compile: make sure imported instantiated types have their methods created
We should be putting a newly instantiated imported type in Instantiate/doInst onto the instTypeList, so its methods/dictionaries are instantiated. To do this, we needed a more general way to add a type to instTypeList, so add NeedInstType(), analogous to NeedRuntimeType(). This has the extra advantage that now all types created by the type substituter are added to instTypeList without any extra code, which was easy to forget. doInst() now correctly calls NeedInstType(). This is a bit aggressive, since a fully instantiated type in a generic function/method may never be used, if the generic method is never instantiated in the local package. But it should be fairly uncommon for a generic method to mention a fully instantiated type (but it does happen in this bug). Fixes both cases mentioned in the bug. Fixed #48185 Change-Id: I19b5012dfac17e306c8005f8595a648b0ab280d0 Reviewed-on: https://go-review.googlesource.com/c/go/+/347909 Trust: Dan Scales <danscales@google.com> Trust: Cuong Manh Le <cuong.manhle.vn@gmail.com> Run-TryBot: Dan Scales <danscales@google.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Keith Randall <khr@golang.org>
Diffstat (limited to 'src/encoding')
0 files changed, 0 insertions, 0 deletions