| 1 | module MatchUnusedField; |
| 2 | (* A name an arm gives a field it never reads is warned of, and the help says to call it _ and the field's name *) |
| 3 | type Arg = variant int(i: INT); real(r: F64; places: INT); end; |
| 4 | |
| 5 | proc negative(a: Arg): BOOL; |
| 6 | var neg: BOOL; |
| 7 | begin |
| 8 | neg := false; |
| 9 | match a of |
| 10 | | int(i): neg := i < 0; |
| 11 | | real(r, places): neg := r < 0.0; |
| 12 | end; |
| 13 | return neg; |
| 14 | end; |
| 15 | |
| 16 | begin |
| 17 | _ := negative(int(1)); |
| 18 | end MatchUnusedField. |