-
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
gc drops struct fields after type error #2110
Labels
Comments
I misled myself. A previous field in the struct referenced a type in a different package that could not be imported (and I got an error for that), but then the compiler ignored the remainder of the struct and gave me the misleading error message. So this is still an unhelpful compile error, but it's not as bad as I thought. Labels changed: added priority-medium, removed priority-high. |
Here's an example program: ---------- package main type S struct { err os.Error Num int } func main() { s := S{} _ = s.Num } ---------- The compiler output is prog.go:4: undefined: os prog.go:10: s.Num undefined (type S has no field or method Num) The first one is the most pertinent, but the second is just misleading, and not obviously the cause. |
This issue was closed by revision 032ffb2. Status changed to Fixed. |
This issue was closed.
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
The text was updated successfully, but these errors were encountered: