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: internal compiler error: method receiver, when missing function type on anonymous function #22389

anisus opened this issue Oct 23, 2017 · 4 comments


Copy link

@anisus anisus commented Oct 23, 2017

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

go1.9.1 windows/amd64

Does this issue reproduce with the latest release?


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


What did you do?

Missed typing the parameter type for an anonymous function which is using the same parameter name as a variable defined in surrounding function.

It is reproducible in

What did you expect to see?

No internal compiler error

What did you see instead?

internal compiler error: method receiver


This comment has been minimized.

Copy link

@ALTree ALTree commented Oct 23, 2017

Appears to be already fixed on tip

$ go version
go version go1.9 linux/amd64

$ go build test.go
# command-line-arguments
./test.go:16:14: f is not a type
./test.go:16:8: internal compiler error: method receiver

goroutine 1 [running]:
runtime/debug.Stack(0x0, 0x0, 0x0)
	/usr/local/go/src/runtime/debug/stack.go:24 +0xa7
cmd/compile/internal/gc.Fatalf(0xb5dd44, 0xf, 0x0, 0x0, 0x0)
	/usr/local/go/src/cmd/compile/internal/gc/subr.go:181 +0x230
cmd/compile/internal/gc.typecheck1(0xc4202f3800, 0x1, 0xc4202f3680)
	/usr/local/go/src/cmd/compile/internal/gc/typecheck.go:1285 +0x4a5d
cmd/compile/internal/gc.typecheck(0xc4202f3800, 0x1, 0xc4202f3680)
	/usr/local/go/src/cmd/compile/internal/gc/typecheck.go:201 +0x782
cmd/compile/internal/gc.typecheckslice(0xc420046d30, 0x2, 0x2, 0x1)
	/usr/local/go/src/cmd/compile/internal/gc/typecheck.go:55 +0x54
	/usr/local/go/src/cmd/compile/internal/gc/main.go:480 +0x1fd0
	/usr/local/go/src/cmd/compile/main.go:49 +0x95

$ gotip version
go version devel +378de1ae43 Tue Oct 17 04:03:16 2017 +0000 linux/amd64

$ gotip build test.go
# command-line-arguments
./test.go:16:14: f is not a type
@griesemer griesemer added this to the Go1.10 milestone Oct 23, 2017

This comment has been minimized.

Copy link

@odeke-em odeke-em commented Oct 31, 2017

@mdempsky your CL and commit f3d4ff7#diff-4e8331dc0915d867dc05240b929434de fixed this issue. I'll mail a CL locking in a test for this issue and then we can close this issue.


This comment has been minimized.

Copy link

@gopherbot gopherbot commented Oct 31, 2017

Change mentions this issue: cmd/compile: test for omitted ICE diagnostics after normal messages

@odeke-em odeke-em self-assigned this Oct 31, 2017
gopherbot pushed a commit that referenced this issue Nov 6, 2017
Updates #22389

@mdempsky's CL 70850 fixed the unnecessary
compile stack trace printing during ICE diagnostics.

This CL adds a test to lock in this behavior.

Change-Id: I9ce49923c80b78cb8c0bb5dc4af3c860a43d63ba
Run-TryBot: Emmanuel Odeke <>
TryBot-Result: Gobot Gobot <>
Reviewed-by: Matthew Dempsky <>

This comment has been minimized.

Copy link

@odeke-em odeke-em commented Nov 6, 2017

Alright, closed with CL and commit 0ba4eba. Thanks for the report @anisus and for tracking it @ALTree and @mdempsky for the actual fix!

@odeke-em odeke-em closed this Nov 6, 2017
@golang golang locked and limited conversation to collaborators Nov 6, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

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