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

reflect: Method type is not correct #1131

Closed
rogpeppe opened this issue Sep 23, 2010 · 1 comment
Closed

reflect: Method type is not correct #1131

rogpeppe opened this issue Sep 23, 2010 · 1 comment

Comments

@rogpeppe
Copy link
Contributor

[This may be a duplicate of issue #770]

package main
import (
        "reflect"
        "fmt"
)
type X int
func (_ X) Foo() { }
func main() {
        v := reflect.NewValue(X(0))
        fmt.Printf("%d\n", v.Type().Method(0).Type.NumIn())
        fmt.Printf("%d\n", v.Method(0).Type().(*reflect.FuncType).NumIn())
        v.Method(0).Call([]reflect.Value{reflect.NewValue(X(0))})
}

this prints:
1
1
panic: FuncValue: wrong argument count

The type of the method should return the argument count
that the method is expected to be called with.

6g darwin 6d3022dfb42b+ tip
@rsc
Copy link
Contributor

rsc commented Sep 23, 2010

Comment 1:

I believe it is.  I will try to bump that one up the list.

Owner changed to r...@golang.org.

Status changed to Duplicate.

Merged into issue #770.

@golang golang locked and limited conversation to collaborators Jun 24, 2016
@rsc rsc removed their assignment Jun 22, 2022
This issue was closed.
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

3 participants