Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(1373)

Issue 131440043: code review 131440043: go.tools/go/types: LookupFieldOrMethod should not retu...

Can't Edit
Can't Publish+Mail
Start Review
Created:
9 years, 8 months ago by gmk
Modified:
9 years, 4 months ago
Reviewers:
CC:
gri, adonovan, golang-codereviews
Visibility:
Public.

Description

go.tools/go/types: LookupFieldOrMethod should not return methods with receiver *T when T is queried. As a nice side-effect, some error strings were improved: T.m now reports "not in method set", not "no field or method"; and T{}.m reports "no field or method" instead of "not in method set". Fixes issue 8584

Patch Set 1 #

Patch Set 2 : diff -r 99ba754ccda058670c32c43ca1506d3b6029b0f7 https://code.google.com/p/go.tools #

Patch Set 3 : diff -r 918b8a7e7b1e97a664074c42688ee666b4fd906d https://code.google.com/p/go.tools #

Total comments: 6
Unified diffs Side-by-side diffs Delta from patch set Stats (+19 lines, -31 lines) Patch
M go/types/call.go View 1 3 chunks +6 lines, -18 lines 2 comments Download
M go/types/lookup.go View 1 1 chunk +1 line, -1 line 2 comments Download
M go/types/testdata/decls0.src View 1 1 chunk +4 lines, -4 lines 0 comments Download
M go/types/testdata/decls3.src View 1 1 chunk +1 line, -1 line 0 comments Download
M go/types/testdata/expr3.src View 1 1 chunk +1 line, -1 line 0 comments Download
M go/types/testdata/methodsets.src View 1 6 chunks +6 lines, -6 lines 2 comments Download

Messages

Total messages: 9
gmk
Hello gri@golang.org, adonovan@google.com (cc: golang-codereviews@googlegroups.com), I'd like you to review this change to https://code.google.com/p/go.tools
9 years, 8 months ago (2014-08-27 16:26:31 UTC) #1
gri
Please abandon. https://codereview.appspot.com/131440043/diff/40001/go/types/call.go File go/types/call.go (right): https://codereview.appspot.com/131440043/diff/40001/go/types/call.go#newcode308 go/types/call.go:308: obj, index, indirect = LookupFieldOrMethod(NewPointer(x.typ), check.pkg, sel) ...
9 years, 8 months ago (2014-08-27 16:36:20 UTC) #2
gri
PS: The correct fix is to make this check (of !indirect && ptrRecv(f)) upon return ...
9 years, 8 months ago (2014-08-27 16:56:20 UTC) #3
gmk
Will abandon. https://codereview.appspot.com/131440043/diff/40001/go/types/call.go File go/types/call.go (right): https://codereview.appspot.com/131440043/diff/40001/go/types/call.go#newcode308 go/types/call.go:308: obj, index, indirect = LookupFieldOrMethod(NewPointer(x.typ), check.pkg, sel) ...
9 years, 8 months ago (2014-08-27 17:18:49 UTC) #4
gmk
*** Abandoned ***
9 years, 8 months ago (2014-08-27 17:20:26 UTC) #5
gri
Thanks. See also my pending CL below. Not quite ready yet, but passes all tests. ...
9 years, 8 months ago (2014-08-27 17:29:22 UTC) #6
gmk
On 2014/08/27 16:56:20, gri wrote: > PS: The correct fix is to make this check ...
9 years, 8 months ago (2014-08-27 17:46:18 UTC) #7
gri
We may need to do this (implicit& outside the lookup). There are various open questions: ...
9 years, 8 months ago (2014-08-27 22:29:51 UTC) #8
gobot
9 years, 4 months ago (2014-12-19 05:12:09 UTC) #9
R=close

To the author of this CL:

The Go project has moved to Gerrit Code Review.

If this CL should be continued, please see the latest version of
https://golang.org/doc/contribute.html for instructions on
how to set up Git and the Go project's Gerrit codereview plugin,
and then create a new change with your current code.

If there has been discussion on this CL, please give a link to it
(golang.org/cl/131440043 is best) in the description in your
new CL.

Thanks very much.
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b