Skip to content

range generics list type error #70842

Closed as not planned
Closed as not planned
@epowsal

Description

@epowsal

Go version

go 1.23.1 windows amd64

Output of go env in your module/workspace:

not need

What did you do?

define type:
type QuickSets[T any] []*QuickSet[T]

add func:
func (qs *QuickSets[T]) Clac(cmpf func(a, b T) int) (c []T) {
as1 := [][]T{}
for qi, a := range qs {
as1 = append(as1, qs[qi])
}
return c
}

What did you see happen?

cannot range over qs (variable of type *QuickSets[T])

What did you expect to see?

make it can range

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions