gokart icon indicating copy to clipboard operation
gokart copied to clipboard

Generics support

Open lachlancooper opened this issue 2 years ago • 0 comments

When I scan a repo using Go 1.18 generics, gokart panics with the message: zeroConst: unexpected T.

For reference, the only function in the repo using generics is as follows:

func mapSlice[T any, M any](a []T, f func(T) M) []M {
	n := make([]M, len(a))
	for i, e := range a {
		n[i] = f(e)
	}
	return n
}

It looks like x/tools/go/ssa is still waiting on generics support. I'm raising this here as a reference and reminder to check that analysis of generics works once that package is fixed.

lachlancooper avatar May 05 '22 01:05 lachlancooper