plugin: type switches fail with reflect-created types #24399
Labels
Milestone
Comments
Actually, on top of the type hashes not matching, there are also duplicate runtime types. The latter alone causes type assertions to also fail. I suspect both (duplicate type descriptors + mismatched type hashes) need to be fixed for type switches to work correctly though. |
@mdempsky can you assign the appropriate label(s) and milestone? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
cmd/compile generates type hashes using MD5, but package reflect uses FNV-1 when dynamically constructing anonymous types. This causes type switches (which first search on type hash) to misbehave when using package plugin:
Notably, the failure goes away if the array type is constructed after the plugin.Open call, or if there's an explicit
*[8675309]int
type in x.go./cc @ianlancetaylor @mwhudson @crawshaw
The text was updated successfully, but these errors were encountered: