go/types, types2: avoid infinitely recursive instantiation through method signatures #48703
Labels
FrozenDueToAge
NeedsFix
The path to resolution is known, but the work has not been done.
release-blocker
Milestone
We've recently started instantiating methods on instantiated types, to simplify their API. However, this introduces an infinite recursion in cases like this:
This is similar to #48098, but will require a different fix; we need to allow these types of methods to be written.
I think there is a straightforward fix: we already have a lazy resolution mechanism for
Named
types, and can use it to expand methods lazily the first time they are accessed (see also #47910). We just need to allow types to escape the type-checking pass with their methods unexpanded, which is a bit subtle.CC @griesemer
The text was updated successfully, but these errors were encountered: