| 1 | module main |
| 2 | |
| 3 | const x = c(c(c('123') or { '456' }) or { '444' }) or { 'xx' } |
| 4 | |
| 5 | fn a(s string) ?string { |
| 6 | if s == 'b' { |
| 7 | return 'a' |
| 8 | } else { |
| 9 | return none |
| 10 | } |
| 11 | } |
| 12 | |
| 13 | fn b(s string) ?string { |
| 14 | if s == 'a' { |
| 15 | return 'b' |
| 16 | } else { |
| 17 | return none |
| 18 | } |
| 19 | } |
| 20 | |
| 21 | fn c(s string) !string { |
| 22 | return a(s) or { b(s) or { 'c' } } |
| 23 | } |
| 24 | |
| 25 | fn test_main() { |
| 26 | assert x == 'c' |
| 27 | } |
| 28 |