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: found illegal assignment #48602

Closed
tdakkota opened this issue Sep 24, 2021 · 3 comments
Closed

cmd/compile: internal compiler error: found illegal assignment #48602

tdakkota opened this issue Sep 24, 2021 · 3 comments
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone

Comments

@tdakkota
Copy link

tdakkota commented Sep 24, 2021

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

$ go version
go version devel go1.18-d413908320 Fri Sep 24 07:22:13 2021 +0000 windows/amd64

Does this issue reproduce with the latest release?

No

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

  • windows/amd64
  • linux/amd64 (godbolt)

What did you do?

https://play.golang.org/p/91xOOjsmJjR

https://go.godbolt.org/z/Y9zjns7xK

What did you expect to see?

Successful compilation.

What did you see instead?

Stack trace
./example.go:18:2: internal compiler error: found illegal assignment main.Iterator[.shape.int_0] -> main.Iterator[main.R₄]; :
	Iterator[.shape.int_0] does not implement Iterator[main.R₄] (wrong type for Iterate method)
		have Iterate(.shape.int_0)
		want Iterate(R₄)

goroutine 1 [running]:
runtime/debug.Stack()
	/root/master/go/src/runtime/debug/stack.go:24 +0x65
cmd/compile/internal/base.FatalfAt({0x41e000, 0xc0}, {0xcf83f4, 0x27}, {0xc0000c2da8, 0x3, 0x3})
	/root/master/go/src/cmd/compile/internal/base/print.go:227 +0x154
cmd/compile/internal/base.Fatalf(...)
	/root/master/go/src/cmd/compile/internal/base/print.go:196
cmd/compile/internal/noder.assignconvfn({0xe4dd90, 0xc00006fdb0}, 0xc00007ff10)
	/root/master/go/src/cmd/compile/internal/noder/transform.go:417 +0x1b2
cmd/compile/internal/noder.transformAssign({0xe4d430, 0xc00006fd60}, {0xc0000c3040, 0x1, 0x2}, {0xc0000c3030, 0x1, 0x7fc9fbacef80})
	/root/master/go/src/cmd/compile/internal/noder/transform.go:363 +0x4b3
cmd/compile/internal/noder.(*subster).node.func1({0xe4d430, 0xc00006ed20})
	/root/master/go/src/cmd/compile/internal/noder/stencil.go:981 +0x5a5
cmd/compile/internal/noder.(*subster).node(0xc000412b60, {0xe4d430, 0xc00006ed20})
	/root/master/go/src/cmd/compile/internal/noder/stencil.go:1166 +0xa5
cmd/compile/internal/noder.(*subster).list(0x13b9620, {0xc000062ca0, 0x2, 0xc0000b4550})
	/root/master/go/src/cmd/compile/internal/noder/stencil.go:1418 +0x8e
cmd/compile/internal/noder.(*irgen).genericSubst(0xc00040e000, 0xc00006fc20, 0xc00007dba0, {0xc00000e330, 0x1, 0x1}, 0x0, 0xc00000c660)
	/root/master/go/src/cmd/compile/internal/noder/stencil.go:762 +0xce6
cmd/compile/internal/noder.(*irgen).getInstantiation(0xc00040e000, 0xc00007dba0, {0xc00000e328, 0x1, 0x1}, 0xc8)
	/root/master/go/src/cmd/compile/internal/noder/stencil.go:640 +0x2b0
cmd/compile/internal/noder.(*irgen).stencil.func1({0xe4d818, 0xc0004022d0})
	/root/master/go/src/cmd/compile/internal/noder/stencil.go:108 +0x2df
cmd/compile/internal/ir.Visit.func1({0xe4d818, 0xc0004022d0})
	/root/master/go/src/cmd/compile/internal/ir/visit.go:105 +0x30
cmd/compile/internal/ir.doNodes({0xc00002e4c0, 0x1, 0x0}, 0xc00000c648)
	/root/master/go/src/cmd/compile/internal/ir/node_gen.go:1512 +0x67
cmd/compile/internal/ir.(*Func).doChildren(0xe4e178, 0xc000072580)
	/root/master/go/src/cmd/compile/internal/ir/func.go:152 +0x2e
cmd/compile/internal/ir.DoChildren(...)
	/root/master/go/src/cmd/compile/internal/ir/visit.go:94
cmd/compile/internal/ir.Visit.func1({0xe4e178, 0xc000072580})
	/root/master/go/src/cmd/compile/internal/ir/visit.go:106 +0x57
cmd/compile/internal/ir.Visit({0xe4e178, 0xc000072580}, 0xc000076e80)
	/root/master/go/src/cmd/compile/internal/ir/visit.go:108 +0xb8
cmd/compile/internal/noder.(*irgen).stencil(0xc00040e000)
	/root/master/go/src/cmd/compile/internal/noder/stencil.go:90 +0x238
cmd/compile/internal/noder.(*irgen).generate(0xc00040e000, {0xc00008ab60, 0x2, 0xb})
	/root/master/go/src/cmd/compile/internal/noder/irgen.go:301 +0x359
cmd/compile/internal/noder.check2({0xc00008ab60, 0x2, 0x2})
	/root/master/go/src/cmd/compile/internal/noder/irgen.go:93 +0x175
cmd/compile/internal/noder.LoadPackage({0xc0000b0110, 0x2, 0x0})
	/root/master/go/src/cmd/compile/internal/noder/noder.go:90 +0x335
cmd/compile/internal/gc.Main(0xd0ba30)
	/root/master/go/src/cmd/compile/internal/gc/main.go:190 +0xaf3
main.main()
	/root/master/go/src/cmd/compile/main.go:55 +0xdd
@ALTree ALTree added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Sep 24, 2021
@ALTree ALTree added this to the Go1.18 milestone Sep 24, 2021
@ALTree
Copy link
Member

ALTree commented Sep 24, 2021

cc @randall77 @danscales

@danscales danscales self-assigned this Sep 24, 2021
@danscales
Copy link
Contributor

I have the fix. This relates to the use of the blank node in FooR any with typeparam type.

@gopherbot
Copy link
Contributor

Change https://golang.org/cl/352117 mentions this issue: cmd/compile: deal with blank nodes with typeparam type during stenciling

@golang golang locked and limited conversation to collaborators Jun 23, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Projects
None yet
Development

No branches or pull requests

4 participants