Using go1.16
Reproduction:
```go
type F64 float64
func (f F64) MarshalText() ([]byte, error) {
return []byte(fmt.Sprint(f)), nil
}
func main() {
m := map[F64]string{F64(math.NaN()): "NaN"}
json.Marshal(m)
}
````
Panics with panic: reflect: call of reflect.Value.Type on zero Value
Change https://golang.org/cl/278632 mentions this issue: encoding/json: fix invalid kind reflect type
See previously #14427, #24075, #20660. (NaN keys are trouble!)
More precisely: NaN ~keys~ are trouble.
More precisely: NaN ~keys~ are trouble.
Float as key is unsuppored, however this bug is about marhsal maps with interface MarshalText :)
Most helpful comment
More precisely: NaN ~keys~ are trouble.