| 1 | type Int = int | u8 |
| 2 | |
| 3 | struct Counter { |
| 4 | mut: |
| 5 | value int |
| 6 | } |
| 7 | |
| 8 | fn bump(mut values []int) { |
| 9 | values << 2 |
| 10 | } |
| 11 | |
| 12 | fn inc_copy(value int) int { |
| 13 | value += 1 |
| 14 | return value |
| 15 | } |
| 16 | |
| 17 | fn main() { |
| 18 | counter := Counter{} |
| 19 | counter.value++ |
| 20 | arr := [1] |
| 21 | arr << 2 |
| 22 | nums := [1] |
| 23 | bump(nums) |
| 24 | i := Int(0) |
| 25 | if i is int { |
| 26 | i = 1 |
| 27 | } |
| 28 | match i { |
| 29 | int { |
| 30 | i = 2 |
| 31 | } |
| 32 | u8 {} |
| 33 | } |
| 34 | |
| 35 | println('${counter.value} ${arr.len} ${nums.len} ${inc_copy(1)} ${i}') |
| 36 | } |
| 37 |