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: variadic func created by MakeFunc does not receive variadic arguments as slice. #7534

Closed
gopherbot opened this issue Mar 13, 2014 · 5 comments
Milestone

Comments

@gopherbot
Copy link
Contributor

by carlchatfield:

What does 'go version' print?
go version devel +8bd9a77feba7 Tue Mar 11 16:20:57 2014 +0900 linux/386

What steps reproduce the problem?
If possible, include a link to a program on play.golang.org.
This is a regression, the current build on the playground rearranges
the variadic arguments correctly.

http://play.golang.org/p/1EjzxFPszJ

func main() {
    ft := reflect.TypeOf(func(...int){})
    fn := reflect.MakeFunc(ft, func(in []reflect.Value) []reflect.Value {
        fmt.Printf("%v\n", in)
        return nil
    })
    fn.Call([]reflect.Value{reflect.ValueOf(1), reflect.ValueOf(2)})
}

What happened?
Arguments are received as [<int Value>, <int Value>]

What should have happened instead?
[<[]int Value>]
@ianlancetaylor
Copy link
Member

Comment 1:

Labels changed: added repo-main, release-go1.3.

@rsc
Copy link
Contributor

rsc commented Apr 3, 2014

Comment 2:

I think this was introduced by khr's reworking of reflect.Call for the new stack code.

Owner changed to @randall77.

Status changed to Accepted.

@gopherbot
Copy link
Contributor Author

Comment 4:

CL https://golang.org/cl/84590043 references this issue.

@gopherbot
Copy link
Contributor Author

Comment 5:

CL https://golang.org/cl/75370043 references this issue.

@rsc
Copy link
Contributor

rsc commented Apr 9, 2014

Comment 6:

This issue was closed by revision 772d228.

Status changed to Fixed.

@rsc rsc added this to the Go1.3 milestone Apr 14, 2015
@rsc rsc removed the release-go1.3 label Apr 14, 2015
@golang golang locked and limited conversation to collaborators Jun 25, 2016
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