go/loader creates a fresh package map for each source package it imports. In
llgoi this caused binary imported packages to be imported anew for every
input line, resulting in spurious type errors and panics in go/ssa when
encountering previously imported types. Fix this by ignoring the provided
package map completely in the importer wrapper and using our own.
Details
Details
Diff Detail
Diff Detail
- Repository
- rL LLVM
Event Timeline
cmd/llgoi/llgoi.go | ||
---|---|---|
101 ↗ | (On Diff #22162) | I'd prefer if we stuck to the contract of go/types.Importer (as before), and instead just set go/types.Config.Packages to the same map each time. I understand that the package map is only read/updated by the importer currently, but I'm not sure if that's guaranteed to be the case forever. Perhaps I'm being paranoid? |
Comment Actions
- Set types.Config.Packages instead of overriding the package map
cmd/llgoi/llgoi.go | ||
---|---|---|
101 ↗ | (On Diff #22162) | Seems reasonable, done. |