cmd/compile/internal/types2: review implementation of indexing of generic types #49275
Labels
FrozenDueToAge
NeedsFix
The path to resolution is known, but the work has not been done.
release-blocker
Milestone
On go tip (generics), the below program gets a compile error
./test.go:6:15: invalid operation: cannot index x (variable of type T constrained by interface{[]int64|map[int]int64})
Program:
That happens even though individually the functions:
and
compile/run fine. We need a fix and/or need to decide exactly which of map/slice/array/string types can be combined in a type constraint, and allow indexing on the type param. (And make rules more explicit if we disallow certain cases.)
@griesemer @findleyr
The text was updated successfully, but these errors were encountered: