refactor/rename: fix build breakage (due to go/types version skew)

Change-Id: Id798ff0acdc9d4a83efe1b760ca32ede6a1aa5bb
Reviewed-on: https://go-review.googlesource.com/14132
Reviewed-by: Alan Donovan <adonovan@google.com>
This commit is contained in:
Alan Donovan 2015-08-31 17:12:12 -04:00
parent 03e05ec5a5
commit 25bacdead0
1 changed files with 2 additions and 2 deletions

View File

@ -124,7 +124,7 @@ func (r *renamer) checkInPackageBlock(from types.Object) {
// Check for conflicts between package block and all file blocks. // Check for conflicts between package block and all file blocks.
for _, f := range info.Files { for _, f := range info.Files {
fileScope := info.Info.Scopes[f] fileScope := info.Info.Scopes[f]
b, prev := fileScope.LookupParent(r.to) b, prev := fileScope.LookupParent(r.to, token.NoPos)
if b == fileScope { if b == fileScope {
r.errorf(from.Pos(), "renaming this %s %q to %q would conflict", r.errorf(from.Pos(), "renaming this %s %q to %q would conflict",
objectKind(from), from.Name(), r.to) objectKind(from), from.Name(), r.to)
@ -210,7 +210,7 @@ func (r *renamer) checkInLocalScope(from types.Object) {
func (r *renamer) checkInLexicalScope(from types.Object, info *loader.PackageInfo) { func (r *renamer) checkInLexicalScope(from types.Object, info *loader.PackageInfo) {
b := from.Parent() // the block defining the 'from' object b := from.Parent() // the block defining the 'from' object
if b != nil { if b != nil {
toBlock, to := b.LookupParent(r.to) toBlock, to := b.LookupParent(r.to, from.Parent().End())
if toBlock == b { if toBlock == b {
// same-block conflict // same-block conflict
r.errorf(from.Pos(), "renaming this %s %q to %q", r.errorf(from.Pos(), "renaming this %s %q to %q",