From 25bacdead0e43d2f2594d05c9827ab179c0e94c6 Mon Sep 17 00:00:00 2001 From: Alan Donovan Date: Mon, 31 Aug 2015 17:12:12 -0400 Subject: [PATCH] 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 --- refactor/rename/check.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/refactor/rename/check.go b/refactor/rename/check.go index 434352a6..8a58d70c 100644 --- a/refactor/rename/check.go +++ b/refactor/rename/check.go @@ -124,7 +124,7 @@ func (r *renamer) checkInPackageBlock(from types.Object) { // Check for conflicts between package block and all file blocks. for _, f := range info.Files { fileScope := info.Info.Scopes[f] - b, prev := fileScope.LookupParent(r.to) + b, prev := fileScope.LookupParent(r.to, token.NoPos) if b == fileScope { r.errorf(from.Pos(), "renaming this %s %q to %q would conflict", 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) { b := from.Parent() // the block defining the 'from' object if b != nil { - toBlock, to := b.LookupParent(r.to) + toBlock, to := b.LookupParent(r.to, from.Parent().End()) if toBlock == b { // same-block conflict r.errorf(from.Pos(), "renaming this %s %q to %q",