summaryrefslogtreecommitdiff
path: root/tests/features/test_destructuring.zc
diff options
context:
space:
mode:
authorSAJJA EASWAR <eshwarsajja20@gmail.com>2026-01-25 22:59:36 +0530
committerSAJJA EASWAR <eshwarsajja20@gmail.com>2026-01-25 22:59:36 +0530
commitebc8b94baa6bc694cb4829e2eb2934a1f17fa6a1 (patch)
tree71b952ad455bf17d5bdea01472f0e2297f25eabe /tests/features/test_destructuring.zc
parent863118c95caac0d69a35f6ae4d2e83844734a8a1 (diff)
parent489336b2101bf16edeec7bfc4379408eb19b936e (diff)
Merge branch 'main' into pr-109
Diffstat (limited to 'tests/features/test_destructuring.zc')
-rw-r--r--tests/features/test_destructuring.zc10
1 files changed, 5 insertions, 5 deletions
diff --git a/tests/features/test_destructuring.zc b/tests/features/test_destructuring.zc
index b898582..3e24001 100644
--- a/tests/features/test_destructuring.zc
+++ b/tests/features/test_destructuring.zc
@@ -13,24 +13,24 @@ fn tuple_ret() -> (int, int) {
}
test "test_destructuring" {
- var p = Point{x: 1, y: 2};
+ let p = Point{x: 1, y: 2};
// Explicit Struct Destructuring (Shorthand)
- var Point{x, y} = p;
+ let Point{x, y} = p;
assert(x == 1, "x is 1");
assert(y == 2, "y is 2");
// Explicit Struct Destructuring (Renamed)
- var Point{x: a, y: b} = p;
+ let Point{x: a, y: b} = p;
assert(a == 1, "a is 1");
assert(b == 2, "b is 2");
// Anonymous Struct Destructuring (Inferred)
// Note: Anonymous block only supports shorthand {x, y} currently.
- // var {x: x2} = p; // Not supported yet in anonymous block parser
+ // let {x: x2} = p; // Not supported yet in anonymous block parser
// Tuple Destructuring
- var (t1, t2) = tuple_ret();
+ let (t1, t2) = tuple_ret();
assert(t1 == 10, "t1 is 10");
assert(t2 == 20, "t2 is 20");