Files
moxa/_test/gen13.go
Marc Vertes f3dbce93a4 interp: improve handling of generic types
When generating a new type, the parameter type was not correctly duplicated in the new AST. This is fixed by making copyNode recursive if needed. The out of order processing of generic types has also been fixed.

Fixes #1488
2023-02-08 11:48:05 +01:00

19 lines
225 B
Go

package main
type Map[K comparable, V any] struct {
ж map[K]V
}
func (m Map[K, V]) Has(k K) bool {
_, ok := m.ж[k]
return ok
}
func main() {
m := Map[string, float64]{}
println(m.Has("test"))
}
// Output:
// false