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: failure to export mutually recursive type parameters #46575

Closed
mdempsky opened this issue Jun 4, 2021 · 2 comments
Closed

cmd/compile: failure to export mutually recursive type parameters #46575

mdempsky opened this issue Jun 4, 2021 · 2 comments
Assignees

Comments

@mdempsky
Copy link
Member

@mdempsky mdempsky commented Jun 4, 2021

I have this test case working with unified IR, and I thought it was working with golang.org/cl/323029 last night when I tested it, but it's currently failing at de61465 when I try compiling with -G=3 due to:

$GOROOT/test/typeparam/mutualimp.dir/a.go:11:6: internal compiler error: weird package in name: .dict => .dict from "", not "/usr/local/google/home/mdempsky/wd/go/test/typeparam/mutualimp.dir/a"
package a

type X int
func (x X) M() X { return x }

func F[T interface{ M() U }, U interface{ M() T }]() {}
func G() { F[X, X]() }
package b

import "./a"

func H() {
	a.F[a.X, a.X]()
	a.G()
}

/cc @danscales @randall77 @griesemer

@danscales danscales self-assigned this Jun 5, 2021
@gopherbot
Copy link

@gopherbot gopherbot commented Jun 7, 2021

Change https://golang.org/cl/325529 mentions this issue: [dev.typeparams] cmd/compile: create .dict Param in the package of the instantiated function

Loading

gopherbot pushed a commit that referenced this issue Jun 7, 2021
…e instantiated function

The instantiated functions are created in the source package of the
generic function, so all lookups of symbols should be relative to that
package, so all symbols are consistently in the source package.

Fixes #46575

Change-Id: Iba67b2ba8014a630c5d4e032c0f2f2fbaaedce65
Reviewed-on: https://go-review.googlesource.com/c/go/+/325529
Reviewed-by: Keith Randall <khr@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
@danscales
Copy link

@danscales danscales commented Jun 8, 2021

Fixed by #46575

Loading

@danscales danscales closed this Jun 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants