From 5113f2157c5aa257ad7ebf555cb6a551701d169a Mon Sep 17 00:00:00 2001 From: Michael Williamson Date: Mon, 10 Aug 2026 10:19:49 +0100 Subject: Add generic struct example without any outputs --- examples/04-sum/src/shapes.hob | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 examples/04-sum/src/shapes.hob (limited to 'examples/04-sum/src/shapes.hob') diff --git a/examples/04-sum/src/shapes.hob b/examples/04-sum/src/shapes.hob new file mode 100644 index 0000000..03a727a --- /dev/null +++ b/examples/04-sum/src/shapes.hob @@ -0,0 +1,17 @@ +/// A 2D shape. +sum Shape { + variant Rectangle; + variant Triangle; + + field width: Int32; +} + +struct Rectangle { + field width: Int32; + field height: Int32; +} + +struct Triangle { + field width: Int32; + field height: Int32; +} -- cgit v1.2.3