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/compile: mkdotargslice: typecheck failed #11750

Closed
TatriX opened this issue Jul 17, 2015 · 3 comments
Closed

cmd/compile: mkdotargslice: typecheck failed #11750

TatriX opened this issue Jul 17, 2015 · 3 comments
Milestone

Comments

@TatriX
Copy link

TatriX commented Jul 17, 2015

go version go1.5beta2 linux/386
Code from go1.4 release does not compile on go 1.5beta2:

package main

func main() {
    fn := func(names ...string) {

    }
    func(names ...string) {
        for _, name := range names {
            fn(name)
        }
    }("one", "two")
}

Gives:

./test.go:11: ... must be last argument
./test.go:11: cannot use fn (type func(...string)) as type string in array element
./test.go:11: internal compiler error: mkdotargslice: typecheck failed

Expected: no errors

@bradfitz bradfitz added this to the Go1.5 milestone Jul 17, 2015
@bradfitz
Copy link
Contributor

/cc @rsc

@rsc rsc changed the title go1.5beta2 internal compiler error: mkdotargslice: typecheck failed cmd/compile: mkdotargslice: typecheck failed Jul 21, 2015
@dr2chase dr2chase self-assigned this Jul 23, 2015
@dr2chase
Copy link
Contributor

Bug introduced with this commit: https://go-review.googlesource.com/#/c/4050/7
Still figuring out how.

    // We are going to append captured variables to input args.

That'll play well with "func(names ...string)", won't it?

@ianlancetaylor
Copy link
Contributor

This was fixed by https://golang.org/cl/12580 (there was a typo in the CL description).

@golang golang locked and limited conversation to collaborators Aug 5, 2016
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

5 participants