-
Notifications
You must be signed in to change notification settings - Fork 17.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cmd/compile: double aliases lead to double serialization of an object #17636
Comments
See also comment in go/internal/gcimporter/bimport.go, method importer.declare. |
@mdempsky suggests:
|
cc: @alandonovan |
Emitting imported.F exactly once in p's export data is not sufficient to avoid duplication. The importer needs to know that p.F1 and importer.F (which it may already have) are the same object, which means, as Matthew says, that the export data for the alias must record the canonical name of the original object. But the qualified name is also not sufficient, since the object definiion is required. I think you need:
where obj is either the definition of the original object, or a back reference to an earlier object. obj should also permit "unknownTag" to represent dangling aliases. |
CL https://golang.org/cl/32575 mentions this issue. |
will serialize the data for
imported.F
twice in the export data for this package, once forF1
and once forF2
.While this doesn't bother the importer (it already can handle multiple imports of the same object), it breaks the original invariant that objects of the current package are serialized exactly once in the export data (we use maps to ensure this for packages and types).
The text was updated successfully, but these errors were encountered: