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

[generics] could not find function body in _test packages #39839

Closed
kovetskiy opened this issue Jun 24, 2020 · 2 comments
Closed

[generics] could not find function body in _test packages #39839

kovetskiy opened this issue Jun 24, 2020 · 2 comments

Comments

@kovetskiy
Copy link

kovetskiy commented Jun 24, 2020

go version devel +2dc2987ac87 Tue Jun 23 23:41:16 2020 +0000 linux/amd64

working directory: bug2

bug2_test.go

package bug2_test

import "testing"

func TestT(t *testing.T) {
	x([]int{1}, 1)
}

func x(type T)(v []T, t T) {

}

Error: (the same with go2go test)

> go tool go2go build
could not find function body for "x"

The bug doesn't appear if:
a) I change package name to bug2, or
b) I move x function to another package (and export it)

@gopherbot
Copy link

Change https://golang.org/cl/239708 mentions this issue: [dev.go2go] go/go2go: add IDs for test files

@ianlancetaylor
Copy link
Contributor

Thanks. This test case, at least, should now be fixed on the dev.go2go branch. I wouldn't be very surprised if there are problems in this area.

gopherbot pushed a commit that referenced this issue Jun 24, 2020
No test because the test harness doesn't support test packages.
(But probably we'll need a better test harness.)

Fixes #39839

Change-Id: I4532b1443dbdd081552ffb78477cbe5039183416
Reviewed-on: https://go-review.googlesource.com/c/go/+/239708
Reviewed-by: Ian Lance Taylor <iant@golang.org>
@golang golang locked and limited conversation to collaborators Jun 24, 2021
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