about summary refs log tree commit diff
path: root/tvix/eval/src/tests/tvix_tests/eval-okay-builtins-tojson-tostring.nix
# Attribute sets with a `__toString` attribute JSON-serialise with a
# string coercion of the function call result.

builtins.toJSON {
  __toString = self: "it's " + (builtins.toString (self.x * self.y));
  x = 21;
  y = 2;
}