Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmd/link, reflect: regression in reflect.Method output #15724

Closed
dsnet opened this issue May 18, 2016 · 2 comments
Closed

cmd/link, reflect: regression in reflect.Method output #15724

dsnet opened this issue May 18, 2016 · 2 comments
Milestone

Comments

@dsnet
Copy link
Member

dsnet commented May 18, 2016

Commit 44d3f89 caused a regression in the reflect package where-by some of the fields of the reflect.Method would be nil or invalid.

Consider the following program:

type Foo interface{}
type Bar struct{}

func (s *Bar) getFoo() Foo { return nil }

func main() {
    t := reflect.ValueOf(&Bar{}).Type()
    fmt.Println(t.Method(0))
}

On go1.6, this would print:
{getFoo main func(*main.Bar) main.Foo <func(*main.Bar) main.Foo Value> 0}

After 44d3f89, this would print:
{getFoo main <nil> <invalid Value> 0}

/cc @crawshaw @randall77 @ianlancetaylor

@dsnet dsnet added this to the Go1.7 milestone May 18, 2016
@randall77
Copy link
Contributor

@mdempsky

@crawshaw
Copy link
Member

This looks like a duplicate of #15673.

@golang golang locked and limited conversation to collaborators May 18, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants