Do not ignore type node when used in a variable declaration with assign. The source node in a assign node can be the 2nd or the 3rd (the 2nd being the type).
14 lines
125 B
Go
14 lines
125 B
Go
package main
|
|
|
|
type T int
|
|
|
|
func (t T) foo() { println("foo", t) }
|
|
|
|
func main() {
|
|
var t T = 2
|
|
t.foo()
|
|
}
|
|
|
|
// Output:
|
|
// foo 2
|