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

mdempsky opened this issue Jun 4, 2021 · 2 comments

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

mdempsky opened this issue Jun 4, 2021 · 2 comments


Copy link

@mdempsky mdempsky commented Jun 4, 2021

I have this test case working with unified IR, and I thought it was working with 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]()

/cc @danscales @randall77 @griesemer

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

@gopherbot gopherbot commented Jun 7, 2021

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


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-by: Keith Randall <>
Reviewed-by: Matthew Dempsky <>
Copy link

@danscales danscales commented Jun 8, 2021

Fixed by #46575


@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
None yet
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants