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/go2go: infinite loop in type checking #39932

reusee opened this issue Jun 30, 2020 · 1 comment

cmd/go2go: infinite loop in type checking #39932

reusee opened this issue Jun 30, 2020 · 1 comment


Copy link

@reusee reusee commented Jun 30, 2020

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


Does this issue reproduce with the latest release?


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

go2go playground

What did you do?

package main

type Foo(type T) interface {
	type T
	Foo() T

func fn(type T Foo)(a T) {

func main() {

What did you expect to see?

program exit without error

What did you see instead?

runtime: goroutine stack exceeds 1000000000-byte limit
runtime: sp=0xc020108388 stack=[0xc020108000, 0xc040108000]
fatal error: stack overflow

runtime stack:
runtime.throw(0x69220d, 0xe)
	/usr/local/go-faketime/src/runtime/panic.go:1116 +0x72
	/usr/local/go-faketime/src/runtime/stack.go:1059 +0x78d
	/usr/local/go-faketime/src/runtime/asm_amd64.s:449 +0x8f

goroutine 1 [running]:
go/types.(*Interface).Named(0xc0000c2280, 0x0)
	<autogenerated>:1 +0x4a fp=0xc020108398 sp=0xc020108390 pc=0x586b4a
go/types.(*Named).Under(0xc0000b82d0, 0x6ddc00, 0xc0000b82d0)
	/usr/local/go-faketime/src/go/types/decl.go:496 +0x5f fp=0xc020108568 sp=0xc020108398 pc=0x539abf
go/types.(*instance).Under(0xc0000ac600, 0xc0000b82d0, 0x6ddac0)
	/usr/local/go-faketime/src/go/types/type.go:990 +0x42 fp=0xc020108590 sp=0xc020108568 pc=0x56e842
go/types.(*instance).Interface(0xc0000ac600, 0xc0000c2280)
	/usr/local/go-faketime/src/go/types/type.go:878 +0x2b fp=0xc0201085b8 sp=0xc020108590 pc=0x56de8b
go/types.(*TypeParam).Bound(0xc0000b0600, 0xc0000b0600)
	/usr/local/go-faketime/src/go/types/type.go:818 +0x34 fp=0xc0201085e0 sp=0xc0201085b8 pc=0x56d4b4
go/types.optype(0x6de060, 0xc0000b0600, 0xc0000b0600, 0xc0000c2280)
	/usr/local/go-faketime/src/go/types/type.go:831 +0x4e fp=0xc020108600 sp=0xc0201085e0 pc=0x56d54e
go/types.(*TypeParam).Interface(0xc0000b0600, 0xc0000b0600)
	/usr/local/go-faketime/src/go/types/type.go:848 +0x37 fp=0xc020108630 sp=0xc020108600 pc=0x56da17
go/types.(*TypeParam).Interface(0xc0000b0600, 0xc0000b0600)
	/usr/local/go-faketime/src/go/types/type.go:848 +0x4b fp=0xc020108660 sp=0xc020108630 pc=0x56da2b
go/types.(*TypeParam).Interface(0xc0000b0600, 0xc0000b0600)
Copy link

@ianlancetaylor ianlancetaylor commented Jun 30, 2020

Thanks. This is already fixed on the dev.go2go branch. The playground isn't all the way up to date.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.