From ecb878e11effdfd91ed1c29f18913e7074a527e4 Mon Sep 17 00:00:00 2001 From: Michael Williamson Date: Thu, 28 Sep 2023 15:44:28 +0100 Subject: Hoist structs --- examples/15-struct-hoisting/shed.toml | 9 +++++++++ examples/15-struct-hoisting/src/HelloWorld.shed | 12 ++++++++++++ 2 files changed, 21 insertions(+) create mode 100644 examples/15-struct-hoisting/shed.toml create mode 100644 examples/15-struct-hoisting/src/HelloWorld.shed (limited to 'examples') diff --git a/examples/15-struct-hoisting/shed.toml b/examples/15-struct-hoisting/shed.toml new file mode 100644 index 00000000..156fa7c6 --- /dev/null +++ b/examples/15-struct-hoisting/shed.toml @@ -0,0 +1,9 @@ +[shed] +main = "HelloWorld" + +[[shed.bins]] +name = "hello-world" + +[[shed.examples]] +bin = "hello-world" +expected-output = "hello, world" diff --git a/examples/15-struct-hoisting/src/HelloWorld.shed b/examples/15-struct-hoisting/src/HelloWorld.shed new file mode 100644 index 00000000..d9caa802 --- /dev/null +++ b/examples/15-struct-hoisting/src/HelloWorld.shed @@ -0,0 +1,12 @@ +val messageParts = MessageParts(.part1 = "hello, ", .part2 = "world\n"); + +fun main() ! Io -> Unit { + print!(messageParts.part1); + print!(messageParts.part2); +} + +struct MessageParts( + .part1: String, + .part2: String, +) { +} -- cgit v1.2.3