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: method definitions based on later-defined methods don't compile (pathological) #7495
http://play.golang.org/p/WMpE0q2wK8 produces: prog.go:7: T.m2 undefined (type T has no method m2) prog.go:7: invalid expression unsafe.Sizeof(T.m2) [process exited with non-zero status] But switching m1 and m2 works: http://play.golang.org/p/uR3wFJcAHq In general, ordering declarations differently won't work: http://play.golang.org/p/iAV8x86giC These are clearly pathological cases but point out some limitations of gc's type checker. gccgo handles these cases w/o problem. go/types has the same problem.