baml._to_string_default

(internal) The structural rendering used by the default `baml.ToString` body.

Reference version

Signature

function baml._to_string_default<T>(value: T) -> string throws never

(internal) The structural rendering used by the default baml.ToString body.

Primitives render naturally (5, true, null); containers and class instances render structurally ([1, 2], Point { x: 1, y: 2 }). A nested value whose runtime class does implement baml.ToString renders through that override, so the default honors overrides at every depth, just as string.from does. Never throws.

Source:<builtin>/baml/conversions.bamlbytes 1881–1967