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 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

This comment has been minimized.

Copy link
Contributor

@randall77 randall77 commented May 18, 2016

@crawshaw

This comment has been minimized.

Copy link
Contributor

@crawshaw crawshaw commented May 18, 2016

This looks like a duplicate of #15673.

@crawshaw crawshaw closed this May 18, 2016
@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
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants
You can’t perform that action at this time.