aboutsummaryrefslogtreecommitdiff
path: root/examples/16-struct-positional-fields/src
diff options
context:
space:
mode:
Diffstat (limited to 'examples/16-struct-positional-fields/src')
-rw-r--r--examples/16-struct-positional-fields/src/HelloWorld.shed6
1 files changed, 4 insertions, 2 deletions
diff --git a/examples/16-struct-positional-fields/src/HelloWorld.shed b/examples/16-struct-positional-fields/src/HelloWorld.shed
index ad6fe426..8880c7e2 100644
--- a/examples/16-struct-positional-fields/src/HelloWorld.shed
+++ b/examples/16-struct-positional-fields/src/HelloWorld.shed
@@ -4,12 +4,14 @@ pub fun main() ! Io -> Unit {
print!(messageParts.part2);
}
+// We put part2 before part1 so that the order of args differs from the lexical
+// field order.
struct MessageParts(
- part1: String,
part2: String,
+ part1: String,
) {
}
fun getMessageParts() -> MessageParts {
- MessageParts("hello, ", "world\n")
+ MessageParts("world\n", "hello, ")
}