//go:build go1.27 && goexperiment.jsonv2

package encoder

import (
	
	
	
	

	
)

// invalidNumberError is the error of a json.Number which is not a JSON number, as encoding/json of Go 1.27
// reports it: an error of its method MarshalJSONTo, which shows the number with its quotes if it is quoted.
func invalidNumberError( json.Number,  bool) error {
	 := string()
	if  {
		 = `"` +  + `"`
	}
	return errors.ErrMarshaler(reflect.TypeFor[*json.Number](),
		fmt.Errorf("cannot parse %q as JSON number: %w", , strconv.ErrSyntax), "MarshalJSONTo")
}