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

Closed
reusee opened this issue Jun 30, 2020 · 1 comment
Closed

cmd/go2go: infinite loop in type checking #39932

reusee opened this issue Jun 30, 2020 · 1 comment

Comments

@reusee
Copy link

reusee commented Jun 30, 2020

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

go2go

Does this issue reproduce with the latest release?

no

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

go2go playground

What did you do?

https://go2goplay.golang.org/p/icGT8mSzT6P

package main

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

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

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
runtime.newstack()
	/usr/local/go-faketime/src/runtime/stack.go:1059 +0x78d
runtime.morestack()
	/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)
....
@ianlancetaylor
Copy link
Contributor

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

@golang golang locked and limited conversation to collaborators Jun 30, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants