]> Cypherpunks repositories - gostls13.git/commit
cmd/compile: set correct line number for method wrappers
authorKeith Randall <khr@google.com>
Mon, 10 Dec 2018 22:19:33 +0000 (14:19 -0800)
committerKeith Randall <khr@golang.org>
Mon, 10 Dec 2018 23:31:21 +0000 (23:31 +0000)
commitf64385b720e59d0cddfe5e05e830665f6ade8083
treef08da01bcdfc70d507109f0da25cf1272c11a3d5
parent0f0b10818bd00b1c5778f7c2fbed72bb06defbba
cmd/compile: set correct line number for method wrappers

When converting a method to a function, like this:

type T ...
func (t T) foo() {
}
var t T
f := t.foo

We need to build a wrapper function for the partially evaluated
method. Currently that wrapper function gets the line number of
the first place where t.foo appears. Instead it should have the
line number of where foo is declared.

Fixes #26839

Change-Id: I7dbe2094e53d5d336f329273f10f8430e0af544e
Reviewed-on: https://go-review.googlesource.com/c/153498
Run-TryBot: Keith Randall <khr@golang.org>
Reviewed-by: Robert Griesemer <gri@golang.org>
src/cmd/compile/internal/gc/closure.go