···154154 | None -> err_type_mismatch d ev.span t ~fnd:("scalar " ^ value))
155155 | String map ->
156156 (* Don't decode null values as strings - they should fail so outer combinators
157157- like 'option' or 'any' can handle them properly *)
158158- if is_null_scalar value then
157157+ like 'option' or 'any' can handle them properly.
158158+ BUT: quoted strings should always be treated as strings, even if they
159159+ look like null (e.g., "" or "null") *)
160160+ if style = `Plain && is_null_scalar value then
159161 err_type_mismatch d ev.span t ~fnd:"null"
160162 else
161161- (* Strings accept any non-null scalar value *)
163163+ (* Strings accept quoted scalars or non-null plain scalars *)
162164 map.dec meta value
163165 | Map m ->
164166 (* Handle Map combinators (e.g., from Jsont.option) *)