cmd/compile: ICE instantiating a generic type B
in type A[T] struct{}; type B[T] A[[]T]
with error
#56626
Labels
compiler/runtime
Issues related to the Go compiler and/or runtime.
FrozenDueToAge
generics
Issue is related to generics
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes.
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
I've put together the following program: https://go.dev/play/p/J8PRzNRJoUi
What did you expect to see?
As far as my Go knowledge goes, I think the above program is valid. I expected to see the program compile and run with no output. If I am wrong and the program is not okay, I would have expected a proper compiler error to be displayed that indicates the problem(s).
What did you see instead?
An internal compiler error. Running this on the Go Playground gives me:
My observations
error
inx := SlicedInner[error]{}
on line 27 makes it compile. I tried other interfaces (includingany
), primitives, struct pointers, ...CallSomeFuncOnInner
(i.e. by uncommenting thefmt.Println
) fixes it, too.The text was updated successfully, but these errors were encountered: