Closed
Description
What version of Go are you using (go version
)?
Playground with v=gotip
.
Does this issue reproduce with the latest release?
Yes.
What did you do?
I tried to write a function that could copy between two pointers to types with an underlying array type.
It can be worked around by removing the array constraint and then manually converting when calling the function, such as in this example. This significantly hurts the ergonomics of the usage of the function, however.
What did you expect to see?
Successful compilation.
What did you see instead?
It claimed that range
and indexing aren't allowed with the given constraints.
./prog.go:18:17: cannot range over out (variable of type *OA)
./prog.go:19:6: invalid operation: cannot index out (variable of type *OA)
./prog.go:19:16: invalid operation: cannot index in (variable of type *IA)
Go build failed.