Skip to content
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: method definitions based on later-defined methods don't compile (pathological) #7495

Open
griesemer opened this issue Mar 8, 2014 · 0 comments

Comments

@griesemer
Copy link
Contributor

commented Mar 8, 2014

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.

@griesemer griesemer added new labels Mar 8, 2014

@bradfitz bradfitz removed the new label Dec 18, 2014

@rsc rsc added this to the Unplanned milestone Apr 10, 2015

@rsc rsc removed release-none labels Apr 10, 2015

@rsc rsc changed the title cmd/gc: method definitions based on later-defined methods don't compile (pathological) cmd/compile: method definitions based on later-defined methods don't compile (pathological) Jun 8, 2015

@rsc rsc added the NeedsFix label Sep 26, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.