| 1 | @[params] |
| 2 | struct FooParams { |
| 3 | type FooType = .first |
| 4 | } |
| 5 | |
| 6 | enum FooType { |
| 7 | first |
| 8 | second |
| 9 | } |
| 10 | |
| 11 | fn foo(params FooParams) string { |
| 12 | match params.type { |
| 13 | .first { |
| 14 | return 'First' |
| 15 | } |
| 16 | .second { |
| 17 | return 'Second' |
| 18 | } |
| 19 | } |
| 20 | } |
| 21 | |
| 22 | fn test_main() { |
| 23 | assert foo(type: .second) == 'Second' |
| 24 | } |
| 25 |