tree-sitter / tree-sitter-go

Go grammar for tree-sitter

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add support for union of types

telyatnikov opened this issue · comments

The following generic function from https://go.dev/doc/tutorial/generics cannot be parsed without error:

func SumIntsOrFloats[K comparable, V int64 | float64](m map[K]V) V {
    var s V
    for _, v := range m {
        s += v
    }
    return s
}