2026.05.16¶
~literalizer.Elmnow acceptsvariable_formon~literalizer.literalize_call, emitting the inference-style bindingmy_data = make_widget (EInt 42)without aname : Valannotation (the call’s return type is not known to the renderer). Awrap_in_file=TrueElm scaffold places the binding inside themainletblock so the call is still exercised when the module is run. See #2245.~literalizer.Cppnow supports theTUPLEheterogeneous_strategy: a fixed-length heterogeneous scalar array that is a dict value or the document root is rendered asstd::make_tuple(...)typedstd::tuple<T0, ...>(with#include <tuple>emitted by the data-dependent preamble) instead ofstd::vector<std::variant<...>>. C++’sTUPLEstrategy does not composeRECORD, so the preamble fires off the tuple ids alone, even when the data has no record-shaped dicts. The default (ERROR)std::variantoutput is unchanged. See #2329.~literalizer.Scalanow supports theTUPLEheterogeneous_strategy, which composesRECORD: a fixed-length heterogeneous scalar array that is a record field, another dict value, or the document root is rendered as a native tuple(e0, e1, ...)typed(T0, T1, ...)(a tuple-valuedcase classfield is declared with the tuple type) instead of raising or widening toList[Any]. Scala 3 (the only version this language targets) imposes no tuple-length limit – lengths past 22 are transparently backed byTupleXXL– so every fixed-length heterogeneous scalar array is representable. The default (ERROR) output is unchanged. See #2330.~literalizer.TypeScriptnow supports theTUPLEheterogeneous_strategy: a fixed-length heterogeneous scalar array that is a dict value or the document root is rendered as an[e0, e1, ...] as consttuple literal, which TypeScript infers as areadonly [T0, T1, ...]tuple type, instead of a widened(T0 | T1)[]array. TypeScript has noRECORDstrategy andas constneeds no imports, so there is no data-dependent preamble. The default (ERROR) union-array output is unchanged. See #2328.~literalizer.Kotlinnow supports theTUPLEheterogeneous_strategy, composingRECORD: a fixed-length heterogeneous scalar array that is a dict value or the document root is rendered as a two-elementPair(...)or three-elementTriple(...)typedPair<...>/Triple<...>, and a record field whose value is such an array becomes a tuple-typed field. Kotlin has no general N-tuple, so an array of any other length raises~literalizer.exceptions.TupleArityNotRepresentableErrorrather than degrading to a homogeneous list. The default (ERROR) output is unchanged. See #2331.~literalizer.literalize_callgains acomment_sourceargument: a sequence of trailing source-code comments, one per generated call, paired positionally. Each non-empty entry is emitted as a line comment after the statement terminator using the target language’s comment syntax (#,//,--, …), falling back to that language’s block-comment form (/* ... */) where there is no line comment. This places the comment where only the core can put it – acall_transformonly sees the pre-terminator call expression, so a transform that appended a line comment would have the terminator commented out. An empty entry emits no comment. A length mismatch raises~literalizer.exceptions.CommentSourceLengthMismatchErrorand a multi-line entry raises~literalizer.exceptions.CommentSourceMultilineError. Languages that assemble the call sequence into a single clause/list/expression (so a separator, terminator or closer would follow the comment on the same line and be swallowed) reject a non-emptycomment_sourcewith~literalizer.exceptions.UnsupportedCallShapeError; the supported set is the languages whose~literalizer.Language.supports_standalone_comments_in_wrapped_callsisTrue. See #2369.~literalizer.FSharpnow acceptsvariable_formon~literalizer.literalize_callfor both~literalizer.NewVariableand~literalizer.ExistingVariable, emitting the inference-style bindinglet my_data = make_widget(42)without thename: Valtype annotation or tagged-enum constructor wrapper that literal bindings use (the call’s return type is not known to the renderer). Existing literal-binding output for F# is unchanged. See #2249.~literalizer.PureScriptnow acceptsvariable_formon~literalizer.literalize_call, emitting the inference-style bindingmy_data = make_widget (PInt 42)without aname :: Typeannotation (the call’s return type is not known to the renderer).wrap_in_file=TruePureScript scaffolds addimport Preludeso the call stub’sUnitresult type resolves; literal-binding output is unchanged. See #2247.~literalizer.Rustunder theRECORDheterogeneous_strategynow raises~literalizer.exceptions.UnrepresentableInputErrorfor a set-valued record field, and for a record field whose value is a dict that is not record-eligible (empty, non-string-keyed, or an ordered map), instead of emitting a struct whose declared field type disagrees with the renderedHashSet/BTreeSet/HashMapliteral and fails to compile.~literalizer.Rocnow acceptsvariable_formon~literalizer.literalize_call, emitting the inference-style bindingmy_data = make_widget (RInt 42i128)without amy_data : Valannotation (the call’s return type is not known to the renderer, and Roc infers it). TheValtag-union alias is omitted from such scaffolds because nothing annotates with: Val; existing literal-binding output is unchanged. See #2250.~literalizer.Smlnow acceptsvariable_formon~literalizer.literalize_call, emitting the inference-style bindingval my_data = make_widget(42)without the: val_tannotation ordatatypeconstructor wrapping used for literal bindings (the call’s return type is not known to the renderer, so SML infers it). See #2248.~literalizer.OCamlnow acceptsvariable_formon~literalizer.literalize_call, for both~literalizer.NewVariableand~literalizer.ExistingVariable, emitting the inference-style bindinglet my_data = make_widget(42)without the: val_tannotation or tag constructor used for literal bindings (the call’s return type is not known to the renderer, so OCaml infers it). The call-binding bypass now also covers the assignment template via the newformat_call_variable_assignmenthook, so OCaml’s non-barelet x : val_t = ...assignment no longer leaks a tag constructor onto a call result. Existing literal-binding output for every language is unchanged. See #2246.~literalizer.Javaand~literalizer.Scalano longer emit output that fails to compile for a post-2038~datetime.datetimeunder theRECORDheterogeneous_strategywithdatetime_format=EPOCH. The epoch seconds now carry the language’s wide-integer suffix and the record component widens accordingly (long/Long) once the value leaves signed 32-bit range, so the declared component type always matches the rendered literal. In-range epochs are unaffected. See #2338.~literalizer.Gono longer emits output that fails to compile for a record field holding a positive integer beyond the signed 64-bit range under theRECORDheterogeneous_strategy. Such a value renders through theuint64(...)overflow fallback, and the generated struct field is now typeduint64to match it instead ofint/int64. Record integer fields formatted with a non-defaultinteger_format,numeric_separatorornumeric_literal_suffixkeep their value-derived field type. In-range integers are unaffected. See #2306.~literalizer.Kotlin,~literalizer.Javaand~literalizer.Scalano longer emit output that fails to compile for a record field holding an integer beyond the signed 64-bit range under theRECORDheterogeneous_strategy. The generateddata class/record/case classfield is now typedBigInteger/BigInteger/BigIntto match the arbitrary-precision overflow-fallback literal instead ofLong/long. In-range integers are unaffected. See #2376.Internal: the
RECORDheterogeneous_strategyno longer threads the already-formatted field literal into the field-type hook.~literalizer.Kotlinnow derives each generateddata classfield’s declared type structurally from the raw value through its own collection openers and scalar mapping (matching the Go/Java/Scala ports), and theformattedstring is dropped from the renderer contract. No generated output changes. See #2305.