2026.05.13

  • ~literalizer.Haskell CURRIED ~literalizer.CallStyle now emits a thunk binding (process :: IO Val / process = ...) for zero-parameter calls instead of a malformed signature with an empty argument type (process ::  -> IO Val).

  • ~literalizer.literalize now raises ~literalizer.exceptions.WrapInFileWithoutVariableNotSupportedError when wrap_in_file=True is combined with variable_form=None for a target language that cannot represent a bare value at file-statement scope. Each ~literalizer._language.Language declares its ability to render this shape via a new supports_no_variable_wrap_in_file flag. Strict-typed compiled languages (Rust, C, C++, Haskell, OCaml, Swift, Ada, D, Dart, C#, Elm, Mojo, Nim, Objective-C, Odin, SML, V, Zig, Go, Java, Kotlin, F#, Scala, Erlang, Gleam, Roc, PureScript, Tcl, Bash, VB, SystemVerilog, Occam) opt out, along with Cobol, Fortran, Php, Lua, Toml, and Dhall, each of which produced a file whose linter rejected the resulting bare-value rendering even though the issue text initially listed them as opt-in. The renderer no longer silently emits invalid output for any of these.

  • ~literalizer.Haskell, ~literalizer.FSharp, ~literalizer.OCaml, and ~literalizer.Sml now expose a CURRIED ~literalizer.CallStyle alongside the existing POSITIONAL member. Selecting it emits curried application calls (process arg1 arg2) with curried stubs in place of the tuple form. ~literalizer.Haskell defaults to CURRIED since curried application is the idiomatic call form in Haskell; F#, OCaml, and SML keep POSITIONAL as the default.

  • ~literalizer.Elm ~literalizer.literalize_call now emits curried-application calls (process (EInt 1) (EInt 2)) with curried type stubs (process : a -> b -> ()) in place of the prior tuple-form (process (EInt 1, EInt 2)). Elm tuple literals cap at three elements, so the tuple form had no representation for calls with four or more parameters; the curried form composes naturally with |> and matches the convention used by elm-format and the standard library.

  • The Language.max_call_parameters attribute has been removed. No remaining language sets a maximum parameter count, so the upstream UnsupportedCallShapeError check in ~literalizer.literalize_call and the corresponding language_cls.max_call_parameters introspection no longer have a load-bearing caller.

  • The supports_commented_dict_call_args flag has been removed from Language. Every (language, shape) pair previously dropped by the test-discovery filter on this flag is either already short-circuited by an earlier exception path or now renders cleanly, leaving the flag with no load-bearing callers.

  • ~literalizer.literalize_call now raises ~literalizer.exceptions.UnsupportedCallShapeError when the innermost segment of target_function collides with one of the target language’s reserved identifiers. The renderer previously produced output that would not parse in the target language.

  • ~literalizer.literalize_call now raises ~literalizer.exceptions.UnsupportedCallShapeError when a call_transform wrapper is supplied for a language whose calls are statements rather than expressions (i.e. call_returns_expression is False). The wrapper cannot consume the call as a value in that case, and the renderer previously emitted invalid output.

  • ~literalizer.literalize_call no longer rejects identity call_transform values on Ada, Fortran, and SystemVerilog. Bare procedure-call statements (Process(x);, call process(x), process(x);) are valid in all three languages, so the prior rejection encoded a constraint that does not exist. The Language.allows_bare_call_statement flag introduced alongside that check has been removed.

  • The PureScript, Roc, and Elm wrapped-call indent helpers no longer carry defensive branches for blank or whitespace-leading lines. These helpers only ever receive single-line call expressions from literalize_call (which uses CollectionLayout.COMPACT for wrapped calls and rejects standalone comments in that path), so the empty-line and continuation arms were unreachable via the golden integration cases. Four unit tests in tests/test_languages.py that drove the Elm helpers directly with constructed multi-line input have been removed in favor of the existing golden-file contract.

  • Mojo ~literalizer.literalize_call now supports refs nested inside dict literals and commented dict-literal call arguments. The typed-stub changes merged in #1972 made both shapes compile cleanly under mojo run --Werror, so the corresponding supports_call_refs_in_dict_literals and supports_commented_dict_call_args flags flip to True for Mojo and two new call_* golden cases are exercised.

  • Mojo and C++ ~literalizer.literalize_call no longer wrap a consumable $ref in the language’s consume form when the underlying value’s type would make the wrapping a hard error or a clang-tidy lint failure. In Mojo, ^ is dropped for register-trivial scalars (Int, Bool, Float64) because Mojo 0.26.1.0+ rejects “transfer from a value of trivial register type” under --Werror. In C++, std::move is dropped for register-trivial types (bool, integer, double, std::chrono::year_month_day, std::chrono::system_clock::time_point) which performance-move-const-arg / hicpp-move-const-arg reject. Non-trivial refs (e.g. List[...], Dict[...], strings, bytes) keep their consume form. Language exposes a new ~literalizer._language.Language.consumable_ref_value_inhibits_consuming_form predicate that languages override to opt into per-value routing; the default (~literalizer._language.never_inhibits_consuming_form) preserves the existing behavior.

  • Renamed VariableTypeHints.AUTO to VariableTypeHints.NEVER for every language. The behavior is unchanged; the new name describes the option (no annotation, defer to the language’s inference) rather than implying intent, and pairs symmetrically with ALWAYS.

  • Every language’s VariableTypeHints enum now exposes a third value, SAFE, alongside NEVER and ALWAYS. SAFE annotates only when the language’s own inference would widen the variable to a permissive type (e.g. unknown[] for an empty TypeScript array, Object[] for an empty Java array), making downstream consumption safer than NEVER without the noise of ALWAYS. The predicate is per-language: TypeScript and Java annotate empty list / set / dict literals; for every other language SAFE currently produces the same output as NEVER while leaving room for a future per-language predicate.

  • Nim ~literalizer.literalize_call now emits the object-variant type declaration when the OBJECT_VARIANT heterogeneous strategy is active, so the rendered call references a defined wrapping type.

  • Mojo typed call stubs now cover bool, float, bytes, date, and datetime argument values (mapped to Bool, Float64, and String respectively), and apply to dotted-method stubs as well as free-function stubs. The generic [*Ts: AnyType](*args: *Ts) form is still emitted when scalar types disagree across calls or any argument is non-scalar.

  • Mojo ~literalizer.Language.format_call_preamble_stub now raises ~literalizer.exceptions.HeterogeneousScalarCollectionError under the default ERROR heterogeneous_strategy when concrete Mojo argument types diverge across calls at one parameter slot (including divergent shapes such as scalar in one call and list in another). VARIANT callers continue to fall back to the generic [*Ts: AnyType](*args: *Ts) form for cross-call divergence pending follow-up wrap machinery.

  • ~literalizer.literalize_call now raises a typed ~literalizer.exceptions.UnsupportedCallShapeError when wrap_in_file=True and the YAML source carries standalone comments but the target language sets supports_standalone_comments_in_wrapped_calls = False (currently Elm, Erlang, Haskell, Jsonnet, PureScript, and Roc). ~literalizer.LiteralizeResult now exposes ~literalizer.LiteralizeResult.contains_standalone_comments so callers that wrap manually via ~literalizer.Language.wrap_calls_with_declarations can apply the same guard.

  • ~literalizer.literalize now raises a typed ~literalizer.exceptions.VariableNameNotSupportedError when variable_form is supplied but the target language sets supports_variable_names = False (currently Json5, Jsonnet, and Yaml). The capability flag is now enforced rather than declarative.

  • supports_variable_names is now True on Clojure, CommonLisp, Julia, Racket, Ruby, and Scheme, reflecting that these languages do support named variable wrapping via literalize’s variable_form argument (and have golden files exercising that behavior).

  • Separated syntactic ref_case validity from stylistic preference. ~literalizer.Language now exposes ~literalizer.Language.supported_ref_cases – a frozenset of cases that produce a syntactically legal identifier – alongside the existing ~literalizer.Language.identifier_cases, which now documents stylistic preference only. literalize and literalize_call validate ref_case against supported_ref_cases, so cases that are syntactically legal but non-idiomatic (e.g. IdentifierCase.CAMEL in Python) are now accepted. Two shared constants, ~literalizer.NON_KEBAB_REF_CASES and ~literalizer.ALL_REF_CASES, cover the common settings.

  • ~literalizer.literalize_call now raises a typed ~literalizer.exceptions.DottedCallTargetNotSupportedError when target_function contains a dot but the target language sets supports_dotted_calls = False (currently only Hcl). The capability flag is now enforced rather than declarative.

  • ~literalizer.literalize_call now raises a typed ~literalizer.exceptions.DottedCallStubNotSupportedError when call_transform produces a dotted wrapper name (e.g. tracer.emit) but the target language sets supports_dotted_call_stub = False. The capability flag is now enforced rather than declarative.

  • ~literalizer.literalize_call now raises a typed ~literalizer.exceptions.FreeFunctionCallNotSupportedError when call_transform produces a bare wrapper name with no dot (e.g. emit) but the target language sets has_free_function_calls = False (currently only Wren). The capability flag is now enforced rather than declarative.

  • Removed the redundant supports_default_set_element_type, supports_default_sequence_element_type, supports_default_dict_value_type, supports_default_dict_key_type, and supports_default_ordered_map_value_type class attributes from LanguageCls and all language implementations. Direct constructor calls already surface unsupported default_*_type keyword arguments through type checking, making these probe flags unnecessary.

  • ~literalizer.literalize_call accepts a new ref_values mapping from {"$ref": "name"} identifiers to the source values declared elsewhere. Supplied ref values now participate in data-driven preamble inference, so generated body declarations such as Haskell’s data Val = ... include types reachable only through refs while the rendered call still emits the bare identifier.