| 1 | interface Number2 {} |
| 2 | |
| 3 | fn t(v Number2) { |
| 4 | match v { |
| 5 | int, i32, isize, i64 { |
| 6 | x := isize(v) |
| 7 | println(x) |
| 8 | assert x == 42 |
| 9 | } |
| 10 | else {} |
| 11 | } |
| 12 | |
| 13 | match v { |
| 14 | int { |
| 15 | x := isize(v) |
| 16 | println(x) |
| 17 | assert x == 42 |
| 18 | } |
| 19 | else {} |
| 20 | } |
| 21 | } |
| 22 | |
| 23 | fn test_cast_interface_value_in_match() { |
| 24 | t(int(42)) |
| 25 | } |
| 26 |