Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
cmd/compile: wrong logic for pkg derivation of unnamed type #21696
Happened to be working in cmd/compile/internal/gc/reflect.go and saw:
I don't believe this is completely correct. There is no guarantee that the first non-embedded field will have a package. The commit message refers to
which the code handles correctly, but I think the code still mishandles
because it will look at X, which has no Pkg, instead of at i, which does. It should probably continue the loop until it finds something with a pkg.
It's not obvious to me that anything is wrong here. The