mirror of
https://github.com/burrowers/garble.git
synced 2026-04-22 23:57:14 +08:00
cdc4b23ac5
When compiling a package that instantiates a generic type from another package, info.Types only contains the instantiated *types.Named. The *types.Struct case in recordFieldToStruct returns early on instantiated structs (field != field.Origin()), so the origin struct was never recorded in fieldToStruct. At rewrite time, looking up the origin field then failed with "could not find struct for field X". Fix by also recursing into typ.Origin() for instantiated named types, so the uninstantiated struct is visited and its fields are recorded. Fixes #1027.