Skip to content

cmd/compile: internal compiler error: found illegal assignment p.F.G -> uint #49242

Closed
@ALTree

Description

@ALTree
$ gotip version
go version devel go1.18-f288526374 Fri Oct 29 04:21:07 2021 +0000 linux/amd64
package p

func F[G interface{ uint }]() int {
	f := func(uint) int { return 0 }
	return f(G(1))
}
$ gotip tool compile crash.go 

crash.go:5:12: internal compiler error: found illegal assignment p.F.G -> uint; 

goroutine 1 [running]:
runtime/debug.Stack()
	/home/alberto/go/src/runtime/debug/stack.go:24 +0x65
cmd/compile/internal/base.FatalfAt({0x0?, 0x0?}, {0xd271dd, 0x27}, {0xc0000ccd90, 0x3, 0x3})
	/home/alberto/go/src/cmd/compile/internal/base/print.go:227 +0x1ca
cmd/compile/internal/base.Fatalf(...)
	/home/alberto/go/src/cmd/compile/internal/base/print.go:196
cmd/compile/internal/noder.assignconvfn({0xe7e678, 0xc00031e240}, 0xc000366540)
	/home/alberto/go/src/cmd/compile/internal/noder/transform.go:423 +0x1b2
cmd/compile/internal/noder.typecheckaste(0xd0?, {0xc00031e2d0?, 0xcd7660?}, 0x0, 0xc0000cceb8?, {0xc00009edb0, 0x1, 0x0?})
	/home/alberto/go/src/cmd/compile/internal/noder/transform.go:499 +0x179
cmd/compile/internal/noder.transformCall(0xc00031e2d0)
	/home/alberto/go/src/cmd/compile/internal/noder/transform.go:160 +0x196
...

Tentatively labeling this as a release blocker since it's a compiler crasher on a valid program with typeparameters.

cc @randall77 @danscales

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions