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: relocation target type not defined #48617

Closed
korzhao opened this issue Sep 24, 2021 · 3 comments
Closed

cmd/link: relocation target type not defined #48617

korzhao opened this issue Sep 24, 2021 · 3 comments

Comments

@korzhao
Copy link
Contributor

@korzhao korzhao commented Sep 24, 2021

What version of Go are you using (go version)?

$ go version
go tip

Does this issue reproduce with the latest release?

Yes

What operating system and processor architecture are you using (go env)?

go env Output
$ go env

What did you do?

package main

type Foo[T any] interface {
	CreateBar() Bar[T]
}

type Bar[T any] func() Bar[T]

func (f Bar[T]) CreateBar() Bar[T] {
	return f
}

func abc[T any]() {
	var b Bar[T] = func() Bar[T] {
		var b Bar[T]
		return b
	}
	var _ Foo[T] = b()
}

func main() {
	abc[int]()
}

What did you expect to see?

What did you see instead?

main.main: relocation target type.noalg.main.Foo[main.T₄] not defined
@cuonglm
Copy link
Member

@cuonglm cuonglm commented Sep 25, 2021

I can't reproduce with:

go version devel go1.18-8854368cb0 Sat Sep 25 01:24:46 2021 +0000 darwin/arm64

Loading

@korzhao
Copy link
Contributor Author

@korzhao korzhao commented Sep 25, 2021

I can't reproduce with:

go version devel go1.18-8854368cb0 Sat Sep 25 01:24:46 2021 +0000 darwin/arm64

Cl352117 also fixed this issue.
I think this is another case of Cl352117 . I want to add a test case, just to cover this.

Loading

@gopherbot
Copy link

@gopherbot gopherbot commented Sep 25, 2021

Change https://golang.org/cl/351858 mentions this issue: test/typeparam: add a test case for issue48617

Loading

gopherbot pushed a commit that referenced this issue Sep 25, 2021
For #48617

Change-Id: I6c00b7912c441ac323a0adede63b7d4a9ae6f92d
Reviewed-on: https://go-review.googlesource.com/c/go/+/351858
Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com>
Reviewed-by: Dan Scales <danscales@google.com>
Trust: Cuong Manh Le <cuong.manhle.vn@gmail.com>
Trust: Dan Scales <danscales@google.com>
Run-TryBot: Cuong Manh Le <cuong.manhle.vn@gmail.com>
TryBot-Result: Go Bot <gobot@golang.org>
@korzhao korzhao closed this Sep 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants