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
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.

Comments

@korzhao
Copy link
Contributor

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 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

@cuonglm cuonglm added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Sep 25, 2021
@korzhao
Copy link
Contributor Author

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.

@gopherbot
Copy link

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

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 as completed Sep 25, 2021
@golang golang locked and limited conversation to collaborators Sep 25, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Projects
None yet
Development

No branches or pull requests

3 participants