2026.05.16.1

  • The mapping arm of the public ValueInput type (accepted by ref_values and bound_refs) is now a covariant-key read-only ValueItemsMap protocol instead of an invariant Mapping, so nested dict literals with any scalar key type (str, int, mixed, …) are accepted by type checkers without an explicit annotation. This is a type-only relaxation that accepts strictly more inputs; runtime behavior is unchanged.

  • ~literalizer.Scala gains the same record_shape_names constructor parameter, a Mapping[frozenset[str], str] from a record shape’s key-set to a custom case class name. A mapped shape is declared and rendered with the given name instead of the auto-generated RecordN; the record_struct_name_prefix counter advances only for the shapes with no custom name. Names are validated as PascalCase Scala identifiers that do not collide with the auto {prefix}{N} pattern or each other, raising ~literalizer.exceptions.InvalidRecordNameError. Its supports_record_shape_names language-class flag is now True. See #2332.

  • ~literalizer.Python gains an opt-in RECORD heterogeneous_strategy (already on ~literalizer.Rust, ~literalizer.Go, ~literalizer.Kotlin, ~literalizer.Scala and ~literalizer.Java). Each record-shaped dict (non-empty, string-keyed) becomes a generated frozen @dataclasses.dataclass declared in the preamble (with an import dataclasses) plus a matching RecordN(field=value, ...) literal; field names are the dict keys verbatim and the class-name prefix is configurable via the new record_struct_name_prefix constructor parameter. Python’s dict is already heterogeneous, so every record-shaped dict is representable as a plain dict; this is purely an idiomatic-output choice, the strategy is opt-in, and the default (ERROR) plain-dict output is unchanged. See #2419.

  • ~literalizer.Java gains the same record_shape_names constructor parameter (already on ~literalizer.Rust, ~literalizer.Go and ~literalizer.Kotlin), a Mapping[frozenset[str], str] from a record shape’s key-set to a custom record name. A mapped shape is declared and rendered with the given name instead of the auto-generated RecordN; the record_struct_name_prefix counter advances only for the shapes with no custom name. Names are validated as PascalCase Java identifiers that do not collide with the auto {prefix}{N} pattern, the wrapper class name (module_name), or each other, raising ~literalizer.exceptions.InvalidRecordNameError. Its supports_record_shape_names language-class flag is now True. See #2333.