diff options
Diffstat (limited to 'examples/30-generic-structs/src')
| -rw-r--r-- | examples/30-generic-structs/src/HelloWorld.shed | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/examples/30-generic-structs/src/HelloWorld.shed b/examples/30-generic-structs/src/HelloWorld.shed new file mode 100644 index 00000000..f5a2f013 --- /dev/null +++ b/examples/30-generic-structs/src/HelloWorld.shed @@ -0,0 +1,15 @@ +pub fun main() ! Io -> Unit { + val messageParts = getMessageParts(); + print!(messageParts.part1); + print!(messageParts.part2); +} + +struct Parts[T1, T2]( + .part1: T1, + .part2: T2, +) { +} + +fun getMessageParts() -> Parts[String, String] { + Parts[String, String](.part1 = "hello, ", .part2 = "world\n") +} |
