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

go/types: Context.Ident not called for method selectors #5669

Closed
isbadawi opened this issue Jun 8, 2013 · 4 comments
Closed

go/types: Context.Ident not called for method selectors #5669

isbadawi opened this issue Jun 8, 2013 · 4 comments

Comments

@isbadawi
Copy link

isbadawi commented Jun 8, 2013

Not sure if this is a bug or I'm not understanding the documentation. In
go/types/api.go:67:

"If Ident != nil, it is called for each identifier id in the AST"

I have a small program here (not runnable in playground because it depends on go/types):
http://play.golang.org/p/xfQXuF4i7w

It parses and type checks a small program defined as a literal string.

What is the expected output?

I would expect to see Ident called for Close at line 5.

What do you see instead?

Ident called for main at 1:9
Ident called for main at 3:6
Ident called for file at 4:3
Ident called for _ at 4:9
Ident called for os at 4:14
Ident called for Create at 4:17
Ident called for file at 5:3
Ident called for file at 5:3

Which compiler are you using (5g, 6g, 8g, gccgo)?
gc

Which operating system are you using?
OSX 10.8.4

Which version are you using?  (run 'go version')
go version go1.1 darwin/amd64
@robpike
Copy link
Contributor

robpike commented Jun 8, 2013

Comment 1:

Labels changed: added priority-soon, removed priority-triage.

Owner changed to @griesemer.

Status changed to Accepted.

@griesemer
Copy link
Contributor

Comment 2:

Yes, this is a bug - the Identifier handling has changed significantly just recently.
Thanks for reporting with a nice, directly usable test case.

@griesemer
Copy link
Contributor

Comment 3:

https://golang.org/cl/9714045

@griesemer
Copy link
Contributor

Comment 4:

This issue was closed by revision golang/tools@63f3103.

Status changed to Fixed.

@golang golang locked and limited conversation to collaborators Jun 24, 2016
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants