From 578bf1f04b48f48225cfa794a27426cca4f6384a Mon Sep 17 00:00:00 2001 From: Michael Williamson Date: Fri, 31 Jul 2026 10:50:10 +0100 Subject: Support singleton structs --- examples/03-sum/src/shapes.hob | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 examples/03-sum/src/shapes.hob (limited to 'examples/03-sum/src/shapes.hob') diff --git a/examples/03-sum/src/shapes.hob b/examples/03-sum/src/shapes.hob new file mode 100644 index 0000000..03a727a --- /dev/null +++ b/examples/03-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